I need to save two collections in my MongoDB using Java. Where one collection is Department and other collection is Employee. Where one Departm
If $id didn't work try just id like this
"employees" : [ { "$ref" : "employee", "id" : 1 }, { "$ref" : "employee", "id" : 2 } ]