Questions tagged [mongodb-shell]

The MongoDB shell is a command-line tool for querying and administering MongoDB.

The MongoDB shell is a command-line tool for MongoDB. It allows for querying collections, as well as admin functions like adding users, copying databases, and profiling.

Mongo Command Line

http://cheat.errtheblog.com/s/mongo

115 questions
0
votes
2 answers

Error Running MongoDB Script on OpenShift Gear

I wrote a database population script (in JavaScript) so that I could easily run it on my local and on the server. I want to run it from the command line so that all I have to do is push it to the server/gear and execute it. The script runs fine on…
Alex311
  • 378
  • 3
  • 12
0
votes
1 answer

How can I change an array of documents to an array of values in MongoDB shell?

So, basically, I have this array of IDs: > arrayDeptID [ { "departamento_id" : 0 }, { "departamento_id" : 2 }, { "departamento_id" : 5 }, { "departamento_id" : 6 } ] And I want to…
Don
  • 45
  • 5
0
votes
1 answer

Chef cookbook for installing mongodb-shell only

I am trying to install a mongo client via chef. Essentially this is what I have been doing in manual installs: sudo vi /etc/yum.repos.d/mongodb.repo [mongodb] name=MongoDB Repository …
akaphenom
  • 6,728
  • 10
  • 59
  • 109
0
votes
2 answers

MongoDB routes all data to one server in a shard cluster

I set up a MongoDB shard cluster on windows for the first time as explained here: http://docs.mongodb.org/manual/tutorial/deploy-shard-cluster/ I used the following script to get up the config servers, mongos instance and mongo data…
tugberk
  • 57,477
  • 67
  • 243
  • 335
0
votes
0 answers

Is there a limit on how much you can process when using mongodb shell scripts?

I'm having a problem with inserting test documents into my MongoDB. I'm using JavaScripts to create my test documents and then running them via the MongoDB Shell. But I'm getting some unexpected results. My script creates a document with the…
Snæbjørn
  • 10,322
  • 14
  • 65
  • 124
0
votes
1 answer

Get all objects for each tag

I'm new in mongodbs mapreduce and for sure I have not completely understood it for now. And I have a problem, which I try to solve for few days without success. I have a collection of let's say posts with a tags field. Now I want to mapreduce a new…
srge
  • 3
  • 2
0
votes
1 answer

How to generate list of documents directly in MongoDB's shell?

I don't wanna use any other language. Just open the MongoDB's shell and create let say 100 000 documents with _id incremented by 1. Is that possible?
acheruns
  • 681
  • 1
  • 7
  • 14
-1
votes
1 answer

how to use "$dateToString" into mongo db 2.6 is any substitute?

I made a script in local development machine mongoDb 4.0 its working flawless but for client server MongoDb is 2.6 so $dateToString is not supported. is there any substitute using $dateToString into mongoDb 2.6. Using MongoDb 4.0…
Shantanu Sharma
  • 666
  • 6
  • 21
-1
votes
1 answer

How to Clone Array To Another Array in Mongo Shell

I have some query to accomplish with some array. In MongoDB Shell var array1 = [1,2,3,4]; var array2 = []; array2 = array1.Clone(); There is no Clone() function in mongodb shell. How can i clone it to another array ?
canmustu
  • 2,304
  • 4
  • 21
  • 34
-1
votes
1 answer

Filter documents in collection A using information from a collection B - how?

Let's assume a collection A with documents of following structure: {_id: N} with N being a positive integer And a second collection B with documents of the following kind: {_id: M, ids: [n1,n2,...]} with n1,n2,... being a positive integers The…
Raffael
  • 19,547
  • 15
  • 82
  • 160
1 2 3 4 5 6 7
8