You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above $lookup operation does NOT work. it should work.
And I found a temporary solution, adding a (virtual) field to the document as following, it works. AddFieldsOperation addMotherId = Aggregation.addFields().addField("motherId") .withValue("$mother.$id") .build(); AggregationOperation motherLookupWorks = Aggregation.lookup( "person", "motherId", "_id", "mother" );
The text was updated successfully, but these errors were encountered:
I write a demo project to demostrate it. https://github.com/ArayChou/DBRefLookupTest . Please run unit test test.QueryTest to produce this issue.
@Document("person") public class PersonPo { @Id private String id; private String name; @DBRef private PersonPo mother; @DocumentReference private PersonPo father; }
AggregationOperation motherLookupDoesNotWork = Aggregation.lookup( "person", "mother.$id", "_id", "mother" );
The above $lookup operation does NOT work. it should work.
And I found a temporary solution, adding a (virtual) field to the document as following, it works.
AddFieldsOperation addMotherId = Aggregation.addFields().addField("motherId") .withValue("$mother.$id") .build(); AggregationOperation motherLookupWorks = Aggregation.lookup( "person", "motherId", "_id", "mother" );
The text was updated successfully, but these errors were encountered: