mongosha
mongosha copied to clipboard
Let's get the paths specified in the collections
const result = collection.get("user"); // => [{ "id": 1, "balance": 3 }, { "id": 2, "balance": 300 }, { "id": 13 "balance": 400 }]
const result = collection.get("user.balance"); // => [3, 300, 400];
const result = collection.get("user.balance", "user.id"); // => [{ "id": 1, "balance": 3 }, { "id": 2, "balance": 300 }, { "id": 13 "balance": 400 }]