ReactiveMongo/ReactiveMongo-BSON

BSONDocument `isEmpty` gives false for empty document

gagandeepkalra opened this issue · 0 comments

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

  1. BSONDocument from an optional element producer, BSONDocument("foo" -> None)
  2. .isEmpty on such document should give true
  3. .elements should give empty sequence

Actual Behavior

  1. .isEmpty gives false
  2. .elements gives empty sequence

For the given document constructor, ElementProducer could be the empty version.

    def apply(elms: ElementProducer*): BSONDocument

Then isEmpty computation based on elms.isEmpty yields wrong result