In Mongodb, how do I add a field to every record? -


i want add field "bio" "about" section of document.

i suppose you're using mongo console. add field each document in collection have use command:

db.foo.update({},{$set : { "about.bio" : ""}} , true, true); 

of course have replace foo real collection name. command use empty string ("") default value new field: can change behaviour changing value in command.

hope helps


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -