File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
bson/src/test/scala/org/mongodb/scala/bson/collections
driver/src/it/scala/org/mongodb/scala Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ class MutableDocumentSpec extends FlatSpec with Matchers {
311311 doc1 should equal(Document (" key" -> BsonString (" value" )))
312312 }
313313
314- it should " support clearn " in {
314+ it should " support clear " in {
315315 val doc1 : Document = Document (" key" -> BsonString (" value" ), " key2" -> BsonString (" value2" ))
316316
317317 doc1.clear()
Original file line number Diff line number Diff line change @@ -194,13 +194,13 @@ class CrudSpec extends RequiresMongoDBISpec {
194194 private def doInsertOne (arguments : BsonDocument ): BsonValue = {
195195 val document = arguments.getDocument(" document" )
196196 collection.get.insertOne(document).futureValue
197- Document ((" insertedId" , document.getOrDefault (" _id" , BsonNull ()))).underlying
197+ Document ((" insertedId" , Option ( document.get (" _id" )).getOrElse( BsonNull ()))).underlying
198198 }
199199
200200 private def doInsertMany (arguments : BsonDocument ): BsonValue = {
201201 val documents = arguments.getArray(" documents" ).asScala.map(_.asDocument())
202202 collection.get.insertMany(documents).futureValue
203- Document ((" insertedIds" , documents.map(_.getOrDefault (" _id" , BsonNull ())))).underlying
203+ Document ((" insertedIds" , documents.map(doc => Option (doc.get (" _id" )).getOrElse( BsonNull ())))).underlying
204204 }
205205
206206 private def doReplaceOne (arguments : BsonDocument ): BsonValue = {
You can’t perform that action at this time.
0 commit comments