[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

how do i add column in mongo db

hi how do i add column in mongo db where do i run this
db.your_collection.update({},{$set : {"new_field":1}},false,true)
0
chalie001
Asked:
chalie001
  • 6
  • 6
1 Solution
 
gurpsbassiCommented:
hi how do i add column in mongo db
mongodb does not have concept of columns. It is document oriented with key value pairs

where do i run this
anywhere that has a connection to mongodb e.g. your java program or mongo viewer e.t.c
0
 
chalie001Author Commented:
mongo
i did this but no luck
0
 
gurpsbassiCommented:
The sceenshot you supplied has a collection of BSON documents. What query did you use to produce it?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
chalie001Author Commented:
I did not do that somebody did that
0
 
gurpsbassiCommented:
Having executed the update , I need to see the output of findall.
0
 
chalie001Author Commented:
Where do I execute the update
0
 
gurpsbassiCommented:
Chalie001 your not listening.

You have already executed the update.

How do you know it hasn't worked?
0
 
chalie001Author Commented:
because the field is not added
0
 
gurpsbassiCommented:
how can you tell?
did you run a query? show me the query and the results!!!!!!
0
 
chalie001Author Commented:
tablethis is my table
0
 
gurpsbassiCommented:
your table looks empty
how about adding a document and then running the update
0
 
chalie001Author Commented:
i did thanks
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now