mongo-java-server
mongo-java-server copied to clipboard
Support $projection for nested fillds
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!!
It’s partially fixed in version 1.29.0
but more work is needed to improve projection of arrays.