Answers for "mongodb get keys of document"

1

mongodb get keys of document

var allKeys = {}; db.YOURCOLLECTION.find().forEach(function(doc){Object.keys(doc).forEach(function(key){allKeys[key]=1})}); allKeys;
Posted by: Guest on February-18-2021

Code answers related to "mongodb get keys of document"

Browse Popular Code Answers by Language