Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how do i add column in mongo db

Posted on 2015-11-25
12
Medium Priority
?
116 Views
Last Modified: 2016-02-10
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
Comment
Question by:chalie001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
12 Comments
 
LVL 16

Expert Comment

by:gurpsbassi
ID: 41317225
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
 

Author Comment

by:chalie001
ID: 41323968
mongo
i did this but no luck
0
 
LVL 16

Expert Comment

by:gurpsbassi
ID: 41324164
The sceenshot you supplied has a collection of BSON documents. What query did you use to produce it?
0
How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

 

Author Comment

by:chalie001
ID: 41332764
I did not do that somebody did that
0
 
LVL 16

Expert Comment

by:gurpsbassi
ID: 41332845
Having executed the update , I need to see the output of findall.
0
 

Author Comment

by:chalie001
ID: 41333884
Where do I execute the update
0
 
LVL 16

Expert Comment

by:gurpsbassi
ID: 41334124
Chalie001 your not listening.

You have already executed the update.

How do you know it hasn't worked?
0
 

Author Comment

by:chalie001
ID: 41337685
because the field is not added
0
 
LVL 16

Expert Comment

by:gurpsbassi
ID: 41338224
how can you tell?
did you run a query? show me the query and the results!!!!!!
0
 

Author Comment

by:chalie001
ID: 41339026
tablethis is my table
0
 
LVL 16

Accepted Solution

by:
gurpsbassi earned 2000 total points
ID: 41339325
your table looks empty
how about adding a document and then running the update
0
 

Author Comment

by:chalie001
ID: 41345914
i did thanks
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
What we learned in Webroot's webinar on multi-vector protection.
Six Sigma Control Plans
Progress
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question