Simple, self-explanatory code snippets.
db.COLLECTION_NAME.aggregate([
{$addFields: {
'THIS_DOCUMENT_KEY_COUNT': {$size: {$objectToArray: "$$ROOT"}},
}},
]);
No comments:
Post a Comment