top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Updation in MongoDB using Meteor

+1 vote
575 views

I want to update Name, Age, and Mark fields in the collection school in MongoDB using Meteor.
Is it possible, then how?

posted Nov 26, 2016 by Jishnu Ramachandran

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
Try something like this (non tested, you may need to fix small issues locally)

schools = new Meteor.collection("schools");
users.update({Name : "Salil"},{$set:{Name : "Salil Agrawal", Age : 20, Marks : 80}});
I want one line command for all. Is it possible.
Not sure if it is possible, but why you need to single line solution where as we can have more readable code using two lines.

Similar Questions
+1 vote

Write a meteor program. Which gets a data from textbox and fetch the results from MongoDB. And Display the corresponding Search results.

+3 votes

I am very new to mongodb, my requirement is need to search a value in two fields. ex: first_name, last_name

I am using PHP as serverside and mongodb as backend.

Can you please suggest, How can I write the query in PHP.

Below is the things, I tried to implement but not succeeded.

db.users.aggregate(
  [
  { $project: { userName: { $concat: [ "$first_name", " - ", "$last_name" ] } } }
  ]
)
+1 vote

I am using mongo db version 2.2.3 . I am having the requirement like user gives the input like "(ash|ben) & (Bus|car)" as search keywords. In this the & is for AND condition and | for the OR condition.
Is there any way to make this nested leywords as a mongodb query in node js. Is there any functionality in mongodb to achieve this?. If not how can make this in any other way?

...