Using the DBREF datatype in MongoDB, a document may look like as shown below. But having the $ref
field in every row feels redundant as every row obviously points to the users
collection.
Is there a way to reference other documents without having the somewhat redundant $ref
-field?
{
$id: {$oid : "4f4603820e25f4c515000001"},
title: "User group",
users: [
{_id: {$ref: "users", $id: { $oid: "4f44af6a024342300e000002"}}, isAdmin: true }
]
],