mongo-java-server icon indicating copy to clipboard operation
mongo-java-server copied to clipboard

Support $projection for nested fillds

Open Gaff opened this issue 4 years ago • 1 comments

As https://github.com/bwaldvogel/mongo-java-server/issues/121 - but for projection inside a regular mongo find() operation.

My test code is like so:

  MongoCollection<Document> _col = ...
  FindIterable<Document> result = _col.find().project(fields(exclude("a.b", "c));

Which comes through to de.bwaldvogel.mongo.backend.projection.Projection.projectDocument()

Should work for both of these forms:

{ "a" : {"b": 1, "xxx" : 0}}

{ "a" : [{"b": 1, "xxx" : 0}]}

Thanks!!

Gaff avatar Apr 28 '20 08:04 Gaff

It’s partially fixed in version 1.29.0 but more work is needed to improve projection of arrays.

bwaldvogel avatar May 23 '20 09:05 bwaldvogel