MongoDB.live, free & fully virtual. June 9th - 10th. Register Now MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

I'm trying to replicate `matchesQuery` from parse in mongo

I’m trying to move away from parse, and use mongo directly, but parse has already saved a huge part of my data to mongo, so I’m writing a lib that mimics parse, and I’m on the matchesQuery function.

So parse keeps relationships as pointers, which means the average relationship field looks like this: _User$bt5w1JhVUa
which is a combination of the class, as well as the id
I want to match the users via other fields in the user class, to pull my meeting
In parse, it would look like this:

const query = new Parse.Query("Meeting");
query.notEqualTo('status', 'cancelled');
const userQuery = new Parse.Query("User");
userQuery.notEqualTo('cancelledAccount', true);
query.matchesQuery('user', userQuery);
query.find()

I’ve done some searches and I see mongodb aggregate and $lookup might be my best bet, but I have no idea how to go about this, since the pointers are stored as _User$bt5w1JhVUa

Can anyone pleas help me