A composition operation for ElementProducer,
so that it forms an additive monoid with the Empty
instance as id
.
import reactivemongo.api.bson.BSONDocument BSONDocument( "foo" -> Some(1), // tuple as BSONElement("foo", BSONInteger(1)) "bar" -> Option.empty[Int] // tuple as empty ElementProducer (no field) )
import reactivemongo.api.bson.BSONDocument BSONDocument( "foo" -> None // tuple as empty ElementProducer (no field) )
import reactivemongo.api.bson.BSONDocument BSONDocument( "foo" -> Some(1), // tuple as BSONElement("foo", BSONInteger(1)) "bar" -> Option.empty[Int] // tuple as empty ElementProducer (no field) )
import reactivemongo.api.bson.BSONDocument BSONDocument( "foo" -> 1 // tuple as BSONElement("foo", BSONInteger(1)) )
import reactivemongo.api.bson.BSONDocument BSONDocument( "foo" -> 1 // tuple as BSONElement("foo", BSONInteger(1)) )