MongoDB storing arrays of ObjectId's
In my database I have to store an array of object ids. What should I use? Something like this: [ObjectId("50350e12a36feb1be6000364"), ObjectId("57350e12a37fef1be6000922"), ObjectId("10350e17d34ffb1be6200925")] or something like this: ["50350e12a36feb1be6000364", "57350e12a37fef1be6000922", "10350e17d34ffb1be6200925"] I could save space with the second, and then cast to ObjectId , but am I loosing anything by using this approach? Do ObjectId s behave like foreign keys in relational databases? I would definitely go with the first approach, storing the ObjectId s directly. This saves space, as