Hi All,
I need to get records from a collection by doing a lookup to match two fields of another collection. We expect to return one field from each of the collections.
I composed a query in the mongodbexport as
“–query '{party:{aggregate([{$lookup:{from:“party_preference_list”,as:“preference”}},{$match:{”$and":[{“preference.party_preferences.selected_preference_value”:“PAPER”}, {“preference.party_preferences.preference_code”:“EOB”}]}},{$project:{“party_role”:1,“preference.card_id”:1}}])}}’"
When I ran mongoexport, it prompted me below error messages:
“error validating settings: query ‘[123 112 97 … ]’ is not valid JSON: invalid character ‘(’ after object key
… try ‘mongoexport --help’ for more information”
I would very appreciate if someone can help on fixing the query.
Thanks, YC