Hi
Trying to insert a document that refers to another doc, using the mongodb node insert action.
For example for collections:
orgs { name: string }
employees { name: string, org_id: objectId }
I want to insert an employee document { name: “bla”, org_id: ObjectId(“68676a2f5528af331c3b8bff”) }
Since ObjectId isn’t a valid JSON it can’t be used in the mongodb node I’ve tried replacing it with either a simple string and and $oid object:
{ name: “bla”, org_id: “68676a2f5528af331c3b8bff” }
{ name: “bla”, org_id: { $oid: “68676a2f5528af331c3b8bff” } }
Both fail the validation bsonType: “objectId”
If there’s no validation on the field, I can insert in either format, but then when doing $lookup there’s no match between the org._id and employee.org_id
The $oid format actually sets a value to an object { $oid: ‘…’ } instead of an ObjectId(…)