MongoDb with Java foreign key

前端 未结 2 893
旧巷少年郎
旧巷少年郎 2021-01-24 22:44

I need to save two collections in my MongoDB using Java. Where one collection is Department and other collection is Employee. Where one Departm

2条回答
  •  日久生厌
    2021-01-24 23:01

    If $id didn't work try just id like this

    "employees" : [ { "$ref" : "employee", "id" : 1 }, { "$ref" : "employee", "id" : 2 } ]

提交回复
热议问题