question
stringlengths
11
28.2k
answer
stringlengths
26
27.7k
tag
stringclasses
130 values
question_id
int64
935
78.4M
score
int64
10
5.49k
I had working Let's encrypt certificates some months ago (with the old letsencrypt client). The server I am using is nginx. Certbot is creating the .well-known folder, but not the acme-challenge folder Now I tried to create new certificates via ~/certbot-auto certonly --webroot -w /var/www/webroot -d domain.com -d www....
The problem was the nginx configuration. I replaced my long configuration files with the simplest config possible: server { listen 80; server_name domain.com www.domain.com git.domain.com; root /var/www/domain/; } Then I was able to issue new certificates. The problem with my long configuration files was (...
NGINX
38,382,739
29
I've got this in my nginx config: location ~ /\. { deny all; } location /.well-known/ { allow all; } But I still can't access http://example.com/.well-known/acme-challenge/taUUGC822PcdnCnW_aADOzObZqFm3NNM5PEzLNFJXRU. How do I allow access to just that one dot directory?
You have a regex location and a prefix location. The regex location takes precedence unless ^~ is used with the prefix location. Try: location ~ /\. { deny all; } location ^~ /.well-known/ { # allow all; } See this document for details.
NGINX
34,259,548
29
I'm trying to install an intermediate certificate on Nginx ( laravel forge ). Right now the certificate is properly installed, just the intermediate that is missing. I've seen that I need to concatenate the current certificate with the intermediate. What is the best/safest way to add the intermediate certificate. Also,...
Nginx expects all server section certificates in a file that you refer with ssl_certificate. Just put all vendor's intermediate certificates and your domain's certificate in a file. It'll look like this. -----BEGIN CERTIFICATE----- MII... -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MII... -----END CERTIFICATE...
NGINX
25,750,890
29
I want to write non-blocking applications. I use apache2, but I was reading about nginx and its advantage with respect to apache processes. I am considering changing out apache for nginx. My question is, is it possible to write non-blocking web applications with php and nginx?. Or is a better idea to try and do this wi...
Writing non blocking applications in php is possible, but it's probably not the best environment to do so, as it wasn't created keeping that in mind! You get a pretty decent control over your child processes using the process control library PCNTL but it obviously won't ever offer you same ease of use that other enviro...
NGINX
16,313,224
29
we have two servers, A and B. Server A is accessed worldwide. He has nginx installed. That's what I have in conf: location /test { proxy_pass http://localserver.com; } What it should do, is translate the addreess http://globalserver.com/test (that is server A) to internal server address http://localserver.com. Howev...
That should work. Nginx should strip the '/test' path on the upstream local server. So what I can say is that is not the cause. To make it a bit better, try this: location /test/ { proxy_pass http://localserver.com/; } The 2 slashes I added at the first 2 lines will avoid mistakenly match '/testABC' and send the wro...
NGINX
15,353,935
29
my nginx server is actually proxying my node backend (which listens on port 3000) with a simple: location /api/ { proxy_pass http://upstream_1; } Where upstream_1 is my node cluster defined in nginx.conf (on port 3000). I'm gonna have to add SSL over http connections, so I have the following question: do I only need t...
If you're using nginx to handle SSL, then your node server will just be using http. upstream nodejs { server 127.0.0.1:4545 max_fails=0; } server { listen 443; ssl on; ssl_certificate newlocalhost.crt; ssl_certificate_key newlocalhost.key; server_na...
NGINX
10,375,659
29
I just installed Passenger 3.0.11 and nginx and got this error: Starting nginx: /opt/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
I got the same error, and I fixed the problem by running sudo ldconfig.
NGINX
8,501,163
29
I am trying to create a docker-compose setup with nginzx, flask, and react. I started my react app with react-create-app (https://github.com/facebook/create-react-app) and haven't changed anything from it yet. My Dockerfile for the react app is: FROM node:10 WORKDIR /usr/src/app # Install app dependencies # A wildcar...
Adding: stdin_open: true to the React component of my docker-compose file fixed my issue. Example: version: '3.1' services: react: build: context: ../react-app/ dockerfile: ./Dockerfile container_name: react volumes: - ../react-app:/usr/src/app ne...
NGINX
60,895,246
28
(I know others have asked this question before, but I'm not able to solve the problem using the solutions proposed in other posts, so i figured i would try to post my configuration files and see if someone could help.) I want to create a container for nginx, and use proxy_pass to pass requests to the container with the...
I figured out how to fix the problem. Got some help to fix the docker-compose.yml, so it looks like this: docker-compose-yml: version: "3" services: web: image: user/repo:web deploy: resources: limits: cpus: "0.1" memory: 50M restart_policy: condition: on-failur...
NGINX
45,717,835
28
I have a Python REST service and I want to serve it using HTTP2. My current server setup is nginx -> Gunicorn. In other words, nginx (port 443 and 80 that redirects to port 443) is running as a reverse proxy and forwards requests to Gunicorn (port 8000, no SSL). nginx is running in HTTP2 mode and I can verify that by u...
Is it possible to serve a Python (Flask) application with HTTP/2? Yes, by the information you provide, you are doing it just fine. In my case (one reverse proxy server and one serving the actual API), which server has to support HTTP2? Now I'm going to tread on thin ice and give opinions. The way HTTP/2 has been d...
NGINX
38,878,880
28
I have installed Gitlab CE version. I can find nginx bundled in Gitlab. However I cannot find a way to restart nginx separately. I have tried sudo service nginx restart but it gives: * Restarting nginx nginx [fail] I have checked all the document but cannot find a solution. I am tr...
To restart only one component of GitLab Omnibus you can execute sudo gitlab-ctl restart <component>. Therefore, to restart Nginx: sudo gitlab-ctl restart nginx As a further note, this same concept is possible with nearly all of the gitlab-ctl commands. For example, sudo gitlab-ctl tail allows you to see all GitLab logs...
NGINX
32,969,612
28
I managed to deploy meteor on my infrastructure (Webfactions). The application seems to work fine but I get the following error in the browser console when my application starts: WebSocket connection to 'ws://.../websocket' failed: Error during WebSocket handshake: Unexpected response code: 400
WebSockets are fast and you don't have to (and shouldn't) disable them. The real cause of this error is that Webfactions uses nginx, and nginx was improperly configured. Here's how to correctly configure nginx to proxy WebSocket requests, by setting proxy_set_header Upgrade $http_upgrade; and proxy_set_header Connectio...
NGINX
17,014,969
28
I compiled the nginx on Ubuntu myself. I start my nginx with -c nginx.conf parameter. In my nginx.conf file, I try to turn off error log with but failed. error_log /dev/null crit; Still got the error message: nginx: [alert] could not open error log file: open() "/usr/nginx/logs/error.log" failed (2: No such file or di...
The syntax for disabling the error log is ok, but the docs state that a default logfile is used before the config is read. (which seems reasonable because how would it otherwise tell you you have an error in your config) Try creating this file by hand with the correct permissions for the user that runs nginx. Or try st...
NGINX
13,371,925
28
I need to keep alive my connection between nginx and upstream nodejs. Just compiled and installed nginx 1.2.0 my configuration file: upstream backend { ip_hash; server dev:3001; server dev:3002; server dev:3003; server dev:3004; keepalive 128; } server { listen 9000; server_name de...
The documentation states that for http keepalive, you should also set proxy_http_version 1.1; and proxy_set_header Connection "";
NGINX
10,395,807
28
I'm trying to cache static content which are basically inside the paths below in virtual server configuration. For some reason files are not being cached. I see several folders and files inside the cache dir but its always something like 20mb no higher no lower. If it were caching images for example would take at least...
Make sure your backend does not return Set-Cookie header. If Nginx sees it, it disables caching. If this is your case, the best option is to fix your backend. When fixing the backend is not an option, it's possible to instruct Nginx to ignore Set-Cookie header proxy_ignore_headers "Set-Cookie"; proxy_hide_header "Set-C...
NGINX
9,230,812
28
I'm developing a small application with C# in .NET and I want to have a small light weight database which does not use much resources. Could you please list some of the best known light weight database softwares.
14/06/2016 Yep... still getting upvotes :-/ 17/03/2014 I'm still receiving upvotes for this, be mindful of the date this was originally answered. Though the main three items listed are still entirely viable, the list will tend towards becoming stale. There are further database technologies available that are not liste...
MongoDB
6,749,556
189
I am trying to create a new folder in the root directory. I tried all kinds of examples. sudo mkdir /data/db sudo mkdir -p /data/db I keep getting: mkdir: /data: Read-only file system
If you have a Mac and updated to Catalina or more recent version, then the root folder is no longer writable. I just changed the directory somewhere else. Been using this command for now mongod --dbpath=/Users/user/data/db
MongoDB
58,034,955
187
I have gone through many blogs and sites about configuring Elasticsearch for MongoDB to index Collections in MongoDB but none of them were straightforward. Please explain to me a step by step process for installing elasticsearch, which should include: configuration run in the browser I am using Node.js with express....
This answer should be enough to get you set up to follow this tutorial on Building a functional search component with MongoDB, Elasticsearch, and AngularJS. If you're looking to use faceted search with data from an API then Matthiasn's BirdWatch Repo is something you might want to look at. So here's how you can setup a...
MongoDB
23,846,971
187
I'm doing a Node.js project that contains sub projects. One sub project will have one Mongodb database and Mongoose will be use for wrapping and querying db. But the problem is Mongoose doesn't allow to use multiple databases in single mongoose instance as the models are build on one connection. To use multiple mongo...
According to the fine manual, createConnection() can be used to connect to multiple databases. However, you need to create separate models for each connection/database: var conn = mongoose.createConnection('mongodb://localhost/testA'); var conn2 = mongoose.createConnection('mongodb://localhost/testB'); // sto...
MongoDB
19,474,712
187
I am using MongoDB with Node.JS. I have a collection which contains a date and other rows. The date is a JavaScript Date object. How can I sort this collection by date?
Just a slight modification to @JohnnyHK answer collection.find().sort({datefield: -1}, function(err, cursor){...}); In many use cases we wish to have latest records to be returned (like for latest updates / inserts).
MongoDB
13,847,766
185
I'm getting the following error: alex@alex-K43U:/$ mongo MongoDB shell version: 2.2.0 connecting to: test Thu Oct 11 11:46:53 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91 exception: connect failed alex@alex-K43U:/$ This is what happens when I try to start mongodb: * Starting database ...
Step 1: Remove lock file. sudo rm /var/lib/mongodb/mongod.lock Step 2: Repair mongodb. sudo mongod --repair Step 3: start mongodb. sudo start mongodb or sudo service mongodb start Step 4: Check status of mongodb. sudo status mongodb or sudo service mongodb status Step 5: Start mongo console. mongo
MongoDB
12,831,939
183
A fairly common requirement in database applications is to track changes to one or more specific entities in a database. I've heard this called row versioning, a log table or a history table (I'm sure there are other names for it). There are a number of ways to approach it in an RDBMS--you can write all changes from ...
Good question, I was looking into this myself as well. Create a new version on each change I came across the Versioning module of the Mongoid driver for Ruby. I haven't used it myself, but from what I could find, it adds a version number to each document. Older versions are embedded in the document itself. The major dr...
MongoDB
3,507,624
182
What is the difference between save and insert in Mongo DB? both looks the same db.users.save({username:"google",password:"google123"}) db.users.insert({username:"google",password:"google123"})
Save Vs Insert : In your given examples, the behavior is essentially the same. save behaves differently if it is passed with an "_id" parameter. For save, If the document contains _id, it will upsert querying the collection on the _id field, If not, it will insert. If a document does not exist with the specified _id v...
MongoDB
16,209,681
180
My response back from MongoDB after querying an aggregated function on document using Python, It returns valid response and i can print it but can not return it. Error: TypeError: ObjectId('51948e86c25f4b1d1c0d303c') is not JSON serializable Print: {'result': [{'_id': ObjectId('51948e86c25f4b1d1c0d303c'), 'api_calls_...
Bson in PyMongo distribution provides json_util - you can use that one instead to handle BSON types from bson import json_util def parse_json(data): return json.loads(json_util.dumps(data))
MongoDB
16,586,180
179
I'm currently having problems in creating a schema for the document below. The response from the server always returns the "trk" field values as [Object]. Somehow I have no idea how this should work, as I tried at least all approaches which made sense to me ;-) If this helps, my Mongoose version is 3.6.20 and MongoDB 2...
You can declare trk by the following ways : - either trk : [{ lat : String, lng : String }] or trk : { type : Array , "default" : [] } In the second case during insertion make the object and push it into the array like db.update({'Searching criteria goes here'}, { $push : { trk : { "...
MongoDB
19,695,058
178
I am using the same connection string on local and production. When the connection string is mongodb://localhost/mydb What is the username and password? Is it secure to keep it this way?
By default mongodb has no enabled access control, so there is no default user or password. To enable access control, use either the command line option --auth or security.authorization configuration file setting. You can use the following procedure or refer to Enabling Auth in the MongoDB docs. Procedure Start MongoDB...
MongoDB
38,921,414
177
I am trying to create and use an enum type in Mongoose. I checked it out, but I'm not getting the proper result. I'm using enum in my program as follows: My schema is: var RequirementSchema = new mongooseSchema({ status: { type: String, enum : ['NEW,'STATUS'], default: 'NEW' }, }) But I ...
The enums here are basically String objects. Change the enum line to enum: ['NEW', 'STATUS'] instead. You have a typo there with your quotation marks.
MongoDB
29,299,477
177
I know that ObjectIds contain the date they were created on. Is there a way to query this aspect of the ObjectId?
Popping Timestamps into ObjectIds covers queries based on dates embedded in the ObjectId in great detail. Briefly in JavaScript code: /* This function returns an ObjectId embedded with a given datetime */ /* Accepts both Date object and string input */ function objectIdWithTimestamp(timestamp) { /* Convert string ...
MongoDB
8,749,971
177
I have a REST service built in node.js with Restify and Mongoose and a mongoDB with a collection with about 30.000 regular sized documents. I have my node service running through pmx and pm2. Yesterday, suddenly, node started crapping out errors with the message "MongoError: Topology was destroyed", nothing more. I hav...
It seems to mean your node server's connection to your MongoDB instance was interrupted while it was trying to write to it. Take a look at the Mongo source code that generates that error Mongos.prototype.insert = function(ns, ops, options, callback) { if(typeof options == 'function') callback = options, options = {...
MongoDB
30,909,492
176
What are the advantages of using NoSQL databases? I've read a lot about them lately, but I'm still unsure why I would want to implement one, and under what circumstances I would want to use one.
Relational databases enforces ACID. So, you will have schema based transaction oriented data stores. It's proven and suitable for 99% of the real world applications. You can practically do anything with relational databases. But, there are limitations on speed and scaling when it comes to massive high availability data...
MongoDB
3,713,313
176
For example, this code results in a collection called "datas" being created var Dataset = mongoose.model('data', dataSchema); And this code results in a collection called "users" being created var User = mongoose.model('user', dataSchema); Thanks
Mongoose is trying to be smart by making your collection name plural. You can however force it to be whatever you want: var dataSchema = new Schema({..}, { collection: 'data' })
MongoDB
10,547,118
175
I've been using mongo on my mac os x 10.8 and suddenly yesterday at my logs appeared this warning (and when starting shell it's present too) - WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 Who could explain, what does it mean? And should I increase number of rlimits somehow?
on mac, you probably using mongodb for development purpose. If yes, then you can ignore this.
MongoDB
16,621,763
174
Is there a query for calculating how many distinct values a field contains in DB. f.e I have a field for country and there are 8 types of country values (spain, england, france, etc...) If someone adds more documents with a new country I would like the query to return 9. Is there easier way then group and count?
MongoDB has a distinct command which returns an array of distinct values for a field; you can check the length of the array for a count. There is a shell db.collection.distinct() helper as well: > db.countries.distinct('country'); [ "Spain", "England", "France", "Australia" ] > db.countries.distinct('country').length ...
MongoDB
14,924,495
173
I have a large collection of 300 question objects in a database test. I can interact with this collection easily through MongoDB's interactive shell; however, when I try to get the collection through Mongoose in an express.js application I get an empty array. My question is, how can I access this already existing datas...
Mongoose added the ability to specify the collection name under the schema, or as the third argument when declaring the model. Otherwise it will use the pluralized version given by the name you map to the model. Try something like the following, either schema-mapped: new Schema({ url: String, text: String, id: Number},...
MongoDB
5,794,834
173
I'm sure MongoDB doesn't officially support "joins". What does this mean? Does this mean "We cannot connect two collections(tables) together."? I think if we put the value for _id in collection A to the other_id in collection B, can we simply connect two collections? If my understanding is correct, MongoDB can connect ...
It's no join since the relationship will only be evaluated when needed. A join (in a SQL database) on the other hand will resolve relationships and return them as if they were a single table (you "join two tables into one"). You can read more about DBRef here: http://docs.mongodb.org/manual/applications/database-refere...
MongoDB
4,067,197
170
What does going with a document based NoSQL option buy you over a KV store, and vice-versa?
A key-value store provides the simplest possible data model and is exactly what the name suggests: it's a storage system that stores values indexed by a key. You're limited to query by key and the values are opaque, the store doesn't know anything about them. This allows very fast read and write operations (a simple di...
MongoDB
3,046,001
169
From MongoDB The Definitive Guide: Documents larger than 4MB (when converted to BSON) cannot be saved to the database. This is a somewhat arbitrary limit (and may be raised in the future); it is mostly to prevent bad schema design and ensure consistent performance. I don't understand this limit, does this mean ...
First off, this actually is being raised in the next version to 8MB or 16MB ... but I think to put this into perspective, Eliot from 10gen (who developed MongoDB) puts it best: EDIT: The size has been officially 'raised' to 16MB So, on your blog example, 4MB is actually a whole lot.. For example, the full uncompre...
MongoDB
4,667,597
169
Recently I start using MongoDB with Mongoose on Nodejs. When I use Model.find method with $or condition and _id field, Mongoose does not work properly. This does not work: User.find({ $or: [ { '_id': param }, { 'name': param }, { 'nickname': param } ] }, function(err, docs) { if(!err) res.send(docs)...
I solved it through googling: var ObjectId = require('mongoose').Types.ObjectId; var objId = new ObjectId( (param.length < 12) ? "123456789012" : param ); // You should make string 'param' as ObjectId type. To avoid exception, // the 'param' must consist of more than 12 characters. User.find( { $or:[ {'_id':objId}, {...
MongoDB
7,382,207
167
I have been trying W3schools tutorial on nodeJS with MongoDB. When I try to implement this example in a nodeJS environment and invoke the function with an AJAX call, I got the error below: TypeError: db.collection is not a function at c:\Users\user\Desktop\Web Project\WebService.JS:79:14 at args.push (c:\Users...
For people on version 3.0 of the MongoDB native NodeJS driver: (This is applicable to people with "mongodb": "^3.0.0-rc0", or a later version in package.json, that want to keep using the latest version.) In version 2.x of the MongoDB native NodeJS driver you would get the database object as an argument to the connect ...
MongoDB
47,662,220
166
I am using Mongoose with my Node.js app and this is my configuration: mongoose.connect(process.env.MONGO_URI, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, useFindAndModify: false }).then(()=>{ console.log(`connection to database established`) }).catch(err=>{ console.log(...
Update Mongoose 5.7.1 was release and seems to fix the issue, so setting up the useUnifiedTopology option work as expected. mongoose.connect(mongoConnectionString, {useNewUrlParser: true, useUnifiedTopology: true}); Original answer I was facing the same issue and decided to deep dive on Mongoose code: https://github....
MongoDB
57,895,175
164
I am working with Docker and I have a stack with PHP, MySQL, Apache and Redis. I need to add MongoDB now so I was checking the Dockerfile for the latest version and also the docker-entrypoint.sh file from the MongoDB Dockerhub but I couldn't find a way to setup a default DB, admin user/password and possibly auth method...
Here another cleaner solution by using docker-compose and a js script. This example assumes that both files (docker-compose.yml and mongo-init.js) lay in the same folder. docker-compose.yml version: '3.7' services: mongodb: image: mongo:latest container_name: mongodb restart: always ...
MongoDB
42,912,755
164
How would you do a many-to-many association with MongoDB? For example; let's say you have a Users table and a Roles table. Users have many roles, and roles have many users. In SQL land you would create a UserRoles table. Users: Id Name Roles: Id Name UserRoles: UserId RoleId How is same sort ...
Depending on your query needs you can put everything in the user document: {name:"Joe" ,roles:["Admin","User","Engineer"] } To get all the Engineers, use: db.things.find( { roles : "Engineer" } ); If you want to maintain the roles in separate documents then you can include the document's _id in the roles array instea...
MongoDB
2,336,700
164
Is there a way to update values in an object? { _id: 1, name: 'John Smith', items: [{ id: 1, name: 'item 1', value: 'one' },{ id: 2, name: 'item 2', value: 'two' }] } Lets say I want to update the name and value items for item where id = 2; I have tried the following w/ mongoose...
You're close; you should use dot notation in your use of the $ update operator to do that: Person.update({'items.id': 2}, {'$set': { 'items.$.name': 'updated item2', 'items.$.value': 'two updated' }}, function(err) { ...
MongoDB
15,691,224
163
Everywhere I look, I see that MongoDB is CP. But when I dig in I see it is eventually consistent. Is it CP when you use safe=true? If so, does that mean that when I write with safe=true, all replicas will be updated before getting the result?
MongoDB is strongly consistent by default - if you do a write and then do a read, assuming the write was successful you will always be able to read the result of the write you just read. This is because MongoDB is a single-master system and all reads go to the primary by default. If you optionally enable reading from...
MongoDB
11,292,215
163
I was wondering if there is way to force a unique collection entry but only if entry is not null. e Sample schema: var UsersSchema = new Schema({ name : {type: String, trim: true, index: true, required: true}, email : {type: String, trim: true, index: true, unique: true} }); 'email' in this case is not requir...
As of MongoDB v1.8+ you can get the desired behavior of ensuring unique values but allowing multiple docs without the field by setting the sparse option to true when defining the index. As in: email : {type: String, trim: true, index: true, unique: true, sparse: true} Or in the shell: db.users.ensureIndex({email: 1},...
MongoDB
7,955,040
163
I'm using the Mongoose Library for accessing MongoDB with node.js Is there a way to remove a key from a document? i.e. not just set the value to null, but remove it? User.findOne({}, function(err, user){ //correctly sets the key to null... but it's still present in the document user.key_to_delete = null; // doe...
In early versions, you would have needed to drop down the node-mongodb-native driver. Each model has a collection object that contains all the methods that node-mongodb-native offers. So you can do the action in question by this: User.collection.update({_id: user._id}, {$unset: {field: 1 }}); Since version 2.0 you can...
MongoDB
4,486,926
163
I have a collection T, with 2 fields: Grade1 and Grade2, and I want to select those with condition Grade1 > Grade2, how can I get a query like in MySQL? Select * from T Where Grade1 > Grade2
You can use a $where. Just be aware it will be fairly slow (has to execute Javascript code on every record) so combine with indexed queries if you can. db.T.find( { $where: function() { return this.Grade1 > this.Grade2 } } ); or more compact: db.T.find( { $where : "this.Grade1 > this.Grade2" } ); UPD for mongodb v.3....
MongoDB
4,442,453
161
When we run a Mongo find() query without any sort order specified, what does the database internally use to sort the results? According to the documentation on the mongo website: When executing a find() with no parameters, the database returns objects in forward natural order. For standard tables, natural order is n...
What is the default sort order when none is specified? The default internal sort order (or natural order) is an undefined implementation detail. Maintaining order is extra overhead for storage engines and MongoDB's API does not mandate predictability outside of an explicit sort() or the special cases of clustered colle...
MongoDB
11,599,069
160
I'm curious as to the pros and cons of using subdocuments vs a deeper layer in my main schema: var subDoc = new Schema({ name: String }); var mainDoc = new Schema({ names: [subDoc] }); or var mainDoc = new Schema({ names: [{ name: String }] }); I'm currently using subdocs everywhere but I am wondering pr...
According to the docs, it's exactly the same. However, using a Schema would add an _id field as well (as long as you don't have that disabled), and presumably uses some more resources for tracking subdocs. Alternate declaration syntax New in v3 If you don't need access to the sub-document schema instance, you may als...
MongoDB
15,208,711
159
Is there any way to dump mongo collection into json format? Either on the shell or using java driver.I am looking for the one with best performance.
Mongo includes a mongoexport utility (see docs) which can dump a collection. This utility uses the native libmongoclient and is likely the fastest method. mongoexport -d <database> -c <collection_name> Also helpful: -o: write the output to file, otherwise standard output is used (docs) --jsonArray: generates a valid j...
MongoDB
8,991,292
159
I have an Email document which has a sent_at date field: { 'sent_at': Date( 1336776254000 ) } If this Email has not been sent, the sent_at field is either null, or non-existant. I need to get the count of all sent/unsent Emails. I'm stuck at trying to figure out the right way to query for this information. I think t...
If the sent_at field is not there when its not set then: db.emails.count({sent_at: {$exists: false}}) If it's there and null, or not there at all: db.emails.count({sent_at: null}) If it's there and null: db.emails.count({sent_at: { $type: 10 }}) The Query for Null or Missing Fields section of the MongoDB manual des...
MongoDB
10,591,543
156
I'm relatively new to MongoDB and am trying to install MongoDB on my Mac with Homebrew, but I'm getting the following error: Error: No available formula with the name "mongodb" ==> Searching for a previously deleted formula (in the last month)... Warning: homebrew/core is shallow clone. To get complete history run: ...
Formula mongodb has been removed from homebrew-core. Check pr-43770 from homebrew-core To our users: if you came here because mongodb stopped working for you, we have removed it from the Homebrew core formulas since it was migrated to a non open-source license. Fortunately, the team of mongodb is maintaining a custom...
MongoDB
57,856,809
155
I've tried db.users.remove(*) Although it returns an error so how do I go about clearing all records?
The argument to remove() is a filter document, so passing in an empty document means 'remove all': db.user.remove({}) However, if you definitely want to remove everything you might be better off dropping the collection. Though that probably depends on whether you have user defined indexes on the collection i.e. whethe...
MongoDB
46,368,368
155
if I have two schemas like: var userSchema = new Schema({ twittername: String, twitterID: Number, displayName: String, profilePic: String, }); var User = mongoose.model('User') var postSchema = new Schema({ name: String, postedBy: User, //User Model Type dateCreated: Date, comments...
It sounds like the populate method is what your looking for. First make small change to your post schema: var postSchema = new Schema({ name: String, postedBy: {type: mongoose.Schema.Types.ObjectId, ref: 'User'}, dateCreated: Date, comments: [{body:"string", by: mongoose.Schema.Types.ObjectId}], }); Th...
MongoDB
18,001,478
155
Everybody. In mongo group query, the result shows only the key(s) in arguments. How to keep the first document in each group like mysql query group. for example: ------------------------------------------------------------------------- | name | age | sex | province | city | area | address | ---------...
If you want to keep the information about the first matching entries for each group, you can try aggregating like: db.test.aggregate([{ $group: { _id : '$name', name : { $first: '$name' }, age : { $first: '$age' }, sex : { $first: '$sex' }, province : { $first: '$p...
MongoDB
16,662,405
155
I am trying to perform a regex query using PyMongo against a MongoDB server. The document structure is as follows { "files": [ "File 1", "File 2", "File 3", "File 4" ], "rootFolder": "/Location/Of/Files" } I want to get all the files that match the pattern *File. I tried doing this as such db.col...
If you want to include regular expression options (such as ignore case), try this: import re regx = re.compile("^foo", re.IGNORECASE) db.users.find_one({"files": regx})
MongoDB
3,483,318
155
I am a complete noob when it comes to the NoSQL movement. I have heard lots about MongoDB and CouchDB. I know there are differences between the two. Which do you recommend learning as a first step into the NoSQL world?
See following links CouchDB Vs MongoDB MongoDB or CouchDB - fit for production? DB-Engines - Comparison CouchDB vs. MongoDB Update: I found great comparison of NoSQL databases. MongoDB (3.2) Written in: C++ Main point: JSON document store License: AGPL (Drivers: Apache) Protocol: Custom, binary (BSON) Master/slave r...
MongoDB
3,375,494
155
Is there an explain function for the Aggregation framework in MongoDB? I can't see it in the documentation. If not is there some other way to check, how a query performs within the aggregation framework? I know with find you just do db.collection.find().explain() But with the aggregation framework I get an error db....
Starting with MongoDB version 3.0, simply changing the order from collection.aggregate(...).explain() to collection.explain().aggregate(...) will give you the desired results (documentation here). For older versions >= 2.6, you will need to use the explain option for aggregation pipeline operations explain:true db.co...
MongoDB
12,702,080
154
In previous versions of Mongoose (for node.js) there was an option to use it without defining a schema var collection = mongoose.noSchema(db, "User"); But in the current version the "noSchema" function has been removed. My schemas are likely to change often and really don't fit in with a defined schema so is there a n...
I think this is what are you looking for Mongoose Strict option: strict The strict option, (enabled by default), ensures that values added to our model instance that were not specified in our schema do not get saved to the db. Note: Do not set to false unless you have good reason. var thingSchema = new Schema({..}...
MongoDB
5,370,846
154
How can I know the count of a model that data has been saved? there is a method of Model.count(), but it doesn't seem to work. var db = mongoose.connect('mongodb://localhost/myApp'); var userSchema = new Schema({name:String,password:String}); userModel =db.model('UserList',userSchema); var userCount = ...
The reason your code doesn't work is because the count function is asynchronous, it doesn't synchronously return a value. Here's an example of usage: userModel.count({}, function( err, count){ console.log( "Number of users:", count ); })
MongoDB
10,811,887
153
What's the syntax for doing a $lookup on a field that is an array of ObjectIds rather than just a single ObjectId? Example Order Document: { _id: ObjectId("..."), products: [ ObjectId("..<Car ObjectId>.."), ObjectId("..<Bike ObjectId>..") ] } Not Working Query: db.orders.aggregate([ { $lookup:...
2017 update $lookup can now directly use an array as the local field. $unwind is no longer needed. Old answer The $lookup aggregation pipeline stage will not work directly with an array. The main intent of the design is for a "left join" as a "one to many" type of join ( or really a "lookup" ) on the possible related d...
MongoDB
34,967,482
152
I'm using MongoDB in a reporting system and have to delete a whole bunch of test documents. While I don't have too much trouble using the JSON-based command-line tools, it gets extremely tedious to have to keep searching for documents, copy-and-pasting OIDs, etc., especially from a command prompt window (ever tried to...
Here are some popular MongoDB GUI administration tools: Open source dbKoda - cross-platform, tabbed editor with auto-complete, syntax highlighting and code formatting (plus auto-save, something Studio 3T doesn't support), visual tools (explain plan, real-time performance dashboard, query and aggregation pipeline build...
MongoDB
3,310,242
152
I am doing MongoDB lookups by converting a string to BSON. Is there a way for me to determine if the string I have is a valid ObjectID for Mongo before doing the conversion? Here is the coffeescript for my current findByID function. It works great, but I'd like to lookup by a different attribute if I determine the stri...
I found that the mongoose ObjectId validator works to validate valid objectIds but I found a few cases where invalid ids were considered valid. (eg: any 12 characters long string) var ObjectId = require('mongoose').Types.ObjectId; ObjectId.isValid('microsoft123'); //true ObjectId.isValid('timtomtamted'); //true ObjectI...
MongoDB
13,850,819
150
Per the Mongoose documentation for MongooseJS and MongoDB/Node.js : When your application starts up, Mongoose automatically calls ensureIndex for each defined index in your schema. While nice for development, it is recommended this behavior be disabled in production since index creation can cause a significant perfor...
I've never understood why the Mongoose documentation so broadly recommends disabling autoIndex in production. Once the index has been added, subsequent ensureIndex calls will simply see that the index already exists and then return. So it only has an effect on performance when you're first creating the index, and at ...
MongoDB
14,342,708
149
I know there are similar questions here but they are either telling me to switch back to regular RDBMS systems if I need transactions or use atomic operations or two-phase commit. The second solution seems the best choice. The third I don't wish to follow because it seems that many things could go wrong and I can't tes...
As of 4.0, MongoDB will have multi-document ACID transactions. The plan is to enable those in replica set deployments first, followed by the sharded clusters. Transactions in MongoDB will feel just like transactions developers are familiar with from relational databases - they'll be multi-statement, with similar semant...
MongoDB
6,635,718
148
To quote the docs: When creating an index, the number associated with a key specifies the direction of the index, so it should always be 1 (ascending) or -1 (descending). Direction doesn't matter for single key indexes or for random access retrieval but is important if you are doing sorts or range queries on c...
MongoDB concatenates the compound key in some way and uses it as the key in a BTree. When finding single items - The order of the nodes in the tree is irrelevant. If you are returning a range of nodes - The elements close to each other will be down the same branches of the tree. The closer the nodes are in the range t...
MongoDB
10,329,104
147
I am using mongodb now. I have a blogpost collection, and it has a tags field which is an array, e.g. blogpost1.tags = ['tag1', 'tag2', 'tag3', 'tag4', 'tag5'] blogpost2.tags = ['tag2', 'tag3'] blogpost3.tags = ['tag2', 'tag3', 'tag4', 'tag5'] blogpost4.tags = ['tag1', 'tag4', 'tag5'] How can I do these search contai...
Try this out: db.blogpost.find({ 'tags' : 'tag1'}); //1 db.blogpost.find({ 'tags' : { $all : [ 'tag1', 'tag2' ] }}); //2 db.blogpost.find({ 'tags' : { $in : [ 'tag3', 'tag4' ] }}); //3
MongoDB
5,366,687
147
This is my first day with MongoDB so please go easy with me :) I can't understand the $unwind operator, maybe because English is not my native language. db.article.aggregate( { $project : { author : 1 , title : 1 , tags : 1 }}, { $unwind : "$tags" } ); The project operator is someth...
The thing to remember is that MongoDB employs an "NoSQL" approach to data storage, so perish the thoughts of selects, joins, etc. from your mind. The way that it stores your data is in the form of documents and collections, which allows for a dynamic means of adding and obtaining the data from your storage locations. T...
MongoDB
16,448,175
146
NoSQL has been getting a lot of attention in our industry recently. I'm really interested in what peoples thoughts are on the best use-cases for its use over relational database storage. What should trigger a developer into thinking that particular datasets are more suited to a NoSQL solution. I'm particularly interest...
Just promise yourself that you will never try to map a relational data model to a NoSQL database like MongoDB or CouchDB... This is the most common mistake developers make when evaluating emerging tech. That approach is analogous to taking a car and trying to use it to pull your cart down the road like a horse. It's a ...
MongoDB
2,875,432
146
We are migrating a database from MySQL to MongoDB for performance reasons and considering what to use for IDs of the MongoDB documents. We are debating between using ObjectIDs, which is the MongoDB default, or using UUIDs instead (which is what we have been using up until now in MySQL). So far, the arguments we have to...
Using UUIDs in Mongo is certainly possible and reasonably well supported. For example, the Mongo docs list UUIDs as one of the common options for the _id field. Considerations Performance – As other answers mention, benchmarks show UUIDs cause a performance drop for inserts. In the worst case measured (going from 10M ...
MongoDB
28,895,067
145
When I run mongo, I get the warning: Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly.
you can use the below command on terminal export LC_ALL=C
MongoDB
26,337,557
145
Looking to do the following query: Entrant .find enterDate : oneMonthAgo confirmed : true .where('pincode.length > 0') .exec (err,entrants)-> Am I doing the where clause properly? I want to select documents where pincode is not null.
You should be able to do this like (as you're using the query api): Entrant.where("pincode").ne(null) ... which will result in a mongo query resembling: entrants.find({ pincode: { $ne: null } }) A few links that might help: The mongoose query api The docs for mongo query operators
MongoDB
16,531,895
145
I have mongo DB installed in the following path c:\mongodb\bin. I have configured my environment variable PATH in advanced settings.I also have mongod running .When I run the following command mongorestore dump from the following path c:\hw1-1\dump (This contains the BSON files) I'm getting this error: Don't know what...
in mongodb 3.0 or above, we should specify the database name to restore mongorestore -d [your_db_name] [your_dump_dir]
MongoDB
21,233,290
143
I have an issue I've not seen before with the Mongoose findByIdAndUpdate not returning the correct model in the callback. Here's the code: var id = args._id; var updateObj = {updatedDate: Date.now()}; _.extend(updateObj, args); Model.findByIdAndUpdate(id, updateObj, function(err, model) { if (e...
In Mongoose 4.0, the default value for the new option of findByIdAndUpdate (and findOneAndUpdate) has changed to false, which means returning the old doc (see #2262 of the release notes). So you need to explicitly set the option to true to get the new version of the doc, after the update is applied: Model.findByIdAndUp...
MongoDB
30,419,575
142
How do I design a scheme such this in MongoDB? I think there are no foreign keys!
How to design table like this in mongodb? First, to clarify some naming conventions. MongoDB uses collections instead of tables. I think there are no foreign keys! Take the following model: student { _id: ObjectId(...), name: 'Jane', courses: [ { course: 'bio101', mark: 85 }, { course: 'chem101', mar...
MongoDB
6,334,048
142
I've installed mongodb and have been able to run it, work with it, do simple DB read / write type stuff. Now I'm trying to set up my Mac to run mongod as a service. I get "Command not found" in response to: init mongod start In response to: ~: service mongod start service: This command still works, but it is depre...
Edit: you should now use brew services start mongodb, as in Gergo's answer... When you install/upgrade mongodb, brew will tell you what to do: To have launchd start mongodb at login: ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents Then to load mongodb now: launchctl load ~/Library/LaunchAgent...
MongoDB
5,596,521
141
Is it possible to do an OR in the $match? I mean something like this: db.articles.aggregate( { $or: [ $match : { author : "dave" }, $match : { author : "john" }] } );
$match: { $or: [{ author: 'dave' }, { author: 'john' }] } Like so, since the $match operator just takes what you would normally put into the find() function
MongoDB
16,902,930
138
var thename = 'Andrew'; db.collection.find({'name':thename}); How do I query case insensitive? I want to find result even if "andrew";
Chris Fulstow's solution will work (+1), however, it may not be efficient, especially if your collection is very large. Non-rooted regular expressions (those not beginning with ^, which anchors the regular expression to the start of the string), and those using the i flag for case insensitivity will not use indexes, ev...
MongoDB
7,101,703
138
I am trying to test out mongoDB and see if it is anything for me. I downloaded the 32bit windows version, but have no idea on how to continue from now on. I normally use the WAMP services for developing on my local computer. Can i run mongoDB on Wamp? However, what's the best (easiest!) way to make it work on windows? ...
Mongo Installation Process in Windows Are you ready for the installation … and use … Technically, it’s not an installation it’s just Downloading… I. Download the zip file http://www.mongodb.org/downloads II. Extract it and copy the files into your desired location. III. Start the DB engine. IV. Test the installatio...
MongoDB
2,404,742
138
I have array in subdocument like this { "_id" : ObjectId("512e28984815cbfcb21646a7"), "list" : [ { "a" : 1 }, { "a" : 2 }, { "a" : 3 }, { "a" : 4 }, { "a" : 5 } ] } Ca...
Using aggregate is the right approach, but you need to $unwind the list array before applying the $match so that you can filter individual elements and then use $group to put it back together: db.test.aggregate([ { $match: {_id: ObjectId("512e28984815cbfcb21646a7")}}, { $unwind: '$list'}, { $match: {'list.a...
MongoDB
15,117,030
137
I am trying to download mongodb and I am following the steps on this link. But when I get to the step: sudo apt-get install -y mongodb-org I get the following error: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package mongodb-org //This is the er...
I have faced the same issue but then fixed it by the changing the package file section command. The steps that I followed were: First try with this command: sudo apt-get install -y mongodb This is the unofficial mongodb package provided by Ubuntu and it is not maintained by MongoDB and conflicts with MongoDB’s officia...
MongoDB
28,945,921
136
I need to write an application with which I can do complex queries using spring-data and MongoDB. I started using the MongoRepository but struggled with complex queries to find examples or understand the Syntax. I'm talking about queries like this: @Repository public interface UserRepositoryInterface extends MongoRepos...
"Convenient" and "powerful to use" are contradicting goals to some degree. Repositories are by far more convenient than templates but the latter of course give you more fine-grained control over what to execute. As the repository programming model is available for multiple Spring Data modules, you'll find more in-depth...
MongoDB
17,008,947
136
I want to copy a collection within the same database and give it a different name - basically take a snapshot. What's the best way to do this? Is there a command, or do I have to copy each record in turn? I'm aware of the cloneCollection command, but it seems to be for copying to another server only. I'm also awar...
> use yourDatabaseName > db.myOriginal.aggregate([{$out: "myCopy"}]) It is a lot faster than doing many inserts in a forEach loop.
MongoDB
10,624,964
135
I'm trying to display a query in MongoDB where a text field is not '' (blank) { 'name' : { $not : '' }} However I get the error invalid use of $not I've looked over the documentation but the examples they use are for complicated cases (with regexp and $not negating another operator). How would I do the simple thing I'...
Use $ne -- $not should be followed by the standard operator: An examples for $ne, which stands for not equal: use test switched to db test db.test.insert({author : 'me', post: ""}) db.test.insert({author : 'you', post: "how to query"}) db.test.find({'post': {$ne : ""}}) { "_id" : ObjectId("4f68b1a7768972d396fe2268"), ...
MongoDB
9,790,878
135
My question is a variation of this one. Since my Java Web-app project requires a lot of read filters/queries and interfaces with tools like GridFS, I'm struggling to think of a sensible way to employ MongoDB in the way the above solution suggests. Therefore, I'm considering running an embedded instance of MongoDB along...
I have found Embedded MongoDB library which looks quite promising and does what you have asked for. Currently supports MongoDB versions: 1.6.5 to 3.1.6, provided the binaries are still available from the configured mirror. Here is short example of use, which I have just tried and it works perfectly: public class Embed...
MongoDB
6,437,226
135
I'm trying to let MongoDB detect a duplicate value based on its index. I think this is possible in MongoDB, but through the Mongoose wrapper things appear to be broken. So for something like this: User = new Schema ({ email: {type: String, index: {unique: true, dropDups: true}} }) I can save 2 users with the same em...
Oops! You just have to restart mongo.
MongoDB
5,535,610
135
I'm trying to update a single subelement contained within an array in a mongodb document. I want to reference the field using its array index (elements within the array don't have any fields that I can guarantee will be unique identifiers). Seems like this should be easy to do, but I can't figure out the syntax. Here's...
As expected, the query is easy once you know how. Here's the syntax, in python: db["my_collection"].update( { "_id": ObjectId(document_id) }, { "$set": { 'documents.'+str(doc_index)+'.content' : new_content_B}} )
MongoDB
11,372,065
133
What is the command to get the number of clients connected to a particular MongoDB server?
connect to the admin database and run db.serverStatus(): > var status = db.serverStatus() > status.connections {"current" : 21, "available" : 15979} > You can directly get by querying db.serverStatus().connections To understand what does MongoDb's db.serverStatus().connections response mean, read the documentati...
MongoDB
8,975,531
133
How to search for documents in a collection that are missing a certain field in MongoDB?
Yeah, it's possible using $exists: db.things.find( { a : { $exists : false } } ); // return if a is missing When is true, $exists matches the documents that contain the field, including documents where the field value is null. If is false, the query returns only the documents that do not contain the field.
MongoDB
5,719,408
133
I'm searching on Google since days and I tried many things but I still can not perform a good full text search on my user collection. I tried ElasticSearch but was pretty impossible to query and paginate... I tried many plugins for Mongoose like ElMongo, mongoose-full-text, Mongoosastic, etc... everyone are really bad ...
You can add a text index to your Mongoose schema definition that lets you use the $text operator in your find queries to search all fields included in the text index. To create an index to support text search on, say, name and profile.something: var schema = new Schema({ name: String, email: String, profile: { ...
MongoDB
28,775,051
132
I'm getting returned a JSON value from MongoDB after I run my query. The problem is I do not want to return all the JSON associated with my return, I tried searching the docs and didn't find a proper way to do this. I was wondering what if it is at possible, and if so what is the proper way of doing such. Example: In ...
I'm not completely clear on what you mean by "returning a field", but you can use a lean() query so that you can freely modify the output, then populate both fields and post-process the result to only keep the field you want: .lean().populate('user', 'email.address facebook.address') .exec(function (err, subscription...
MongoDB
26,691,543
132
When running a service inside a container, let's say mongodb, the command docker run -d myimage will exit instantly, and return the container id. In my CI script, I run a client to test mongodb connection, right after running the mongo container. The problem is: the client can't connect because the service is not up ...
Found this simple solution, been looking for something better but no luck... until [ "`docker inspect -f {{.State.Running}} CONTAINERNAME`"=="true" ]; do sleep 0.1; done; or if you want to wait until the container is reporting as healthy (assuming you have a healthcheck) until [ "`docker inspect -f {{.State.Health...
MongoDB
21,183,088
132
I encountered a strange behavior of mongo and I would like to clarify it a bit... My request is simple as that: I would like to get a size of single document in collection. I found two possible solutions: Object.bsonsize - some javascript method that should return a size in bytes db.collection.stats() - where there ...
In the previous call of Object.bsonsize(), Mongodb returned the size of the cursor, rather than the document. Correct way is to use this command: Object.bsonsize(db.test.findOne()) With findOne(), you can define your query for a specific document: Object.bsonsize(db.test.findOne({type:"auto"})) This will return the ...
MongoDB
22,008,822
131
as the title says, I want to perform a find (one) for a document, by _id, and if doesn't exist, have it created, then whether it was found or was created, have it returned in the callback. I don't want to update it if it exists, as I've read findAndModify does. I have seen many other questions on Stackoverflow regardin...
Beginning with MongoDB 2.4, it's no longer necessary to rely on a unique index (or any other workaround) for atomic findOrCreate like operations. This is thanks to the $setOnInsert operator new to 2.4, which allows you to specify updates which should only happen when inserting documents. This, combined with the upsert ...
MongoDB
16,358,857
130
I have a large amount of data in a collection in mongodb which I need to analyze. How do i import that data to pandas? I am new to pandas and numpy. EDIT: The mongodb collection contains sensor values tagged with date and time. The sensor values are of float datatype. Sample Data: { "_cls" : "SensorReport", "_id" : Ob...
pymongo might give you a hand, followings is some code I'm using: import pandas as pd from pymongo import MongoClient def _connect_mongo(host, port, username, password, db): """ A util for making a connection to mongo """ if username and password: mongo_uri = 'mongodb://%s:%s@%s:%s/%s' % (username, p...
MongoDB
16,249,736
130
Doc: { _id: 5150a1199fac0e6910000002, name: 'some name', items: [{ id: 23, name: 'item name 23' },{ id: 24, name: 'item name 24' }] } Is there a way to pull a specific object from an array? I.E. how do I pull the entire item object with id 23 from the items array. I have tried: ...
try.. db.mycollection.update( { '_id': ObjectId("5150a1199fac0e6910000002") }, { $pull: { items: { id: 23 } } }, false, // Upsert true, // Multi );
MongoDB
15,641,492
130
Being new to Spring Boot I am wondering on how I can configure connection details for MongoDB. I have tried the normal examples but none covers the connection details. I want to specify the database that is going to be used and the url/port of the host that runs MongoDB. Any hints or tips?
Just to quote Boot Docs: You can set spring.data.mongodb.uri property to change the url, or alternatively specify a host/port. For example, you might declare the following in your application.properties: spring.data.mongodb.host=mongoserver spring.data.mongodb.port=27017 All available options for spring.data.mongodb...
MongoDB
23,515,295
129
With PyMongo, when I try to retrieve objects sorted by their 'number' and 'date' fields like this: db.test.find({"number": {"$gt": 1}}).sort({"number": 1, "date": -1}) I get this error: TypeError: if no direction is specified, key_or_list must be an instance of list What's wrong with my sort query?
sort should be a list of key-direction pairs, that is db.test.find({"number": {"$gt": 1}}).sort([("number", 1), ("date", -1)]) The reason why this has to be a list is that the ordering of the arguments matters and dicts are not ordered in Python < 3.6
MongoDB
10,242,149
129
If I have a record like this; { "text": "text goes here", "words": ["text", "goes", "here"] } How can I match multiple words from it in MongoDB? When matching a single word I can do this; db.find({ words: "text" }) But when I try this for multiple words, it doesn't work; db.find({ words: ["text", "here"] }) I'm ...
Depends on whether you're trying to find documents where words contains both elements (text and here) using $all: db.things.find({ words: { $all: ["text", "here"] }}); or either of them (text or here) using $in: db.things.find({ words: { $in: ["text", "here"] }});
MongoDB
8,145,523
128
I know how to... Remove a single document. Remove the collection itself. Remove all documents from the collection with Mongo. But I don't know how to remove all documents from the collection with Mongoose. I want to do this when the user clicks a button. I assume that I need to send an AJAX request to some endpoint a...
DateTime.remove({}, callback) The empty object will match all of them.
MongoDB
28,139,638
126