Tag: c

67 votes
20 answers
2.1K views
Create a folder if it doesn't already exist

I've run into a few cases with WordPress installs with Bluehost where I've encountered errors with m

avatar
Dorinda
0 1 0 9
asked 07 September, 2021
49 votes
6 answers
2.5K views
Stop Mongoose from creating _id property for sub-document array items

If you have subdocument arrays, Mongoose automatically creates ids for each one. Example: { _id: "mainId"

avatar
Corrin
0 1 0 9
asked 07 September, 2021
54 votes
22 answers
611 views
Avoid "current URL string parser is deprecated" warning by setting useNewUrlParser to true

I have a database wrapper class that establishes a connection to some MongoDB instance: async connect(connect

avatar
Jeff
0 1 0 9
asked 07 September, 2021
62 votes
22 answers
3K views
How to select a single field for all documents in a MongoDB collection?

In my MongoDB, I have a student collection with 10 records having fields name and roll. One record of this col

avatar
Serina
0 1 0 9
asked 07 September, 2021
48 votes
30 answers
437 views
Render basic HTML view?

I have a basic node.js app that I am trying to get off the ground using Express framework. I have a views fol

avatar
Clarice
0 1 0 9
asked 07 September, 2021
56 votes
23 answers
2.1K views
How do I remove documents using Node.js Mongoose?

FBFriendModel.find({ id: 333 }, function (err, docs) { docs.remove(); //Remove all the documents that

avatar
Majorie
0 1 0 9
asked 07 September, 2021
59 votes
12 answers
818 views
How do I manage MongoDB connections in a Node.js web application?

I'm using the node-mongodb-native driver with MongoDB to write a website. I have some questions about ho

avatar
Forrest
0 1 0 9
asked 07 September, 2021
57 votes
24 answers
2.8K views
MongoDB: Is it possible to make a case-insensitive query?

Example: > db.stuff.save({"foo":"bar"}); > db.stuff.find({"foo":"bar"}).count(); 1 > db.stuff.find(

avatar
Thurman
0 1 0 9
asked 07 September, 2021
56 votes
7 answers
2.3K views
"continue" in cursor.forEach()

I'm building an app using meteor.js and MongoDB and I have a question about cursor.forEach(). I want to c

avatar
Suzan
0 1 0 9
asked 07 September, 2021
66 votes
8 answers
778 views
MySQL vs MongoDB 1000 reads

I have been very excited about MongoDb and have been testing it lately. I had a table called posts in MySQL wi

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
56 votes
18 answers
1.2K views
How to secure MongoDB with username and password

I want to set up user name & password authentication for my MongoDB instance, so that any remote access wi

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
59 votes
14 answers
2.5K views
Retrieve only the queried element in an object array in MongoDB collection

Suppose you have the following documents in my collection: { "_id":ObjectId("562e7c594c12942f08fe4192"),

avatar
Clarice
0 1 0 9
asked 07 September, 2021
62 votes
23 answers
2.8K views
How do I update/upsert a document in Mongoose?

Perhaps it's the time, perhaps it's me drowning in sparse documentation and not being able to wrap m

avatar
Rufus
0 1 0 9
asked 07 September, 2021
60 votes
19 answers
1.3K views
MongoDB or CouchDB - fit for production?

I was wondering if anyone can tell me if MongoDB or CouchDB are ready for a production environment.

avatar
Boyd
0 1 0 9
asked 07 September, 2021
53 votes
28 answers
3K views
Mongod complains that there is no /data/db folder

I am using my new mac for the first time today. I am following the get started guide on the mongodb.org up unt

avatar
Robyn
0 1 0 9
asked 07 September, 2021
52 votes
8 answers
544 views
Pretty print in MongoDB shell as default

Is there a way to tell Mongo to pretty print output? Currently, everything is output to a single line and it&a

avatar
Percy
0 1 0 9
asked 07 September, 2021
52 votes
10 answers
1.3K views
MongoDB relationships: embed or reference?

I'm new to MongoDB--coming from a relational database background. I want to design a question structure w

avatar
Robyn
0 1 0 9
asked 07 September, 2021
51 votes
15 answers
1.8K views
How to get the last N records in mongodb?

I can't find anywhere it has been documented this. By default, the find() operation will get the records

avatar
Bryant
0 1 0 9
asked 07 September, 2021
53 votes
7 answers
603 views
When to use CouchDB over MongoDB and vice versa

I am stuck between these two NoSQL databases. In my project I will be creating a database within a database.

avatar
Margo
0 1 0 9
asked 07 September, 2021
61 votes
21 answers
1.2K views
How can I SELECT rows with MAX(Column value), PARTITION by another column in MYSQL?

My table is: id home datetime player resource 1 10 04/03/2009 john 399 2 11 04/03/2009 juliet 244 5 12 04/03/

avatar
Lawanda
0 1 0 9
asked 07 September, 2021