You can specify multiple fields to the $push
operator
db.collection.update(
{ _id :1 },
{ $push : { array1 : "1", array2 : "5" }}
)
More Related Contents:
- Does MongoDB’s $in clause guarantee order
- $lookup on ObjectId’s in an array
- Update field in exact element array in MongoDB
- Return only matched sub-document elements within a nested array
- Converting string to date in mongodb
- Querying internal array size in MongoDB
- Check if every element in array matches condition
- MongoDB wildcard in the key of a query
- MongoDB nested lookup with 3 levels
- How can I get a random record from MongoDB?
- MongoDB Full and Partial Text Search
- Matching ObjectId to String for $graphLookup
- Mongodb Join on _id field from String to ObjectId
- Difference between count() and find().count() in MongoDB
- Mongodb aggregation lookup with conditions
- How to get back the Original document back after aggregation
- How to insert an element to MongoDB internal list?
- MongoDB lookup when foreign field is an array of objects
- Get the latest record from mongodb collection
- Search on multiple collections in MongoDB
- How to stop insertion of Duplicate documents in a mongodb collection
- MongoDB nested array query
- Pull and addtoset at the same time with mongo
- How does MongoDB order their docs in one collection? [duplicate]
- Update embedded object inside array inside array in MongoDB
- count array occurrences across all documents with mongo
- How can I sort a Meteor collection by time of insertion?
- Mongodb concat int and string
- mongodb aggregate query isn’t returning proper sum on using $sum
- MongoDB aggregate within daily grouping [duplicate]