You can copy the entire database if the database is used only for nodebb
mongodump -o /mydir/
mongorestore /mydir/
when transferring a database to another server, you need to copy the database dump and run the command
mongorestore /mydir/
The user and all the data will be automatically transferred
Database INSERT function
-
Hello everybody. I have already asked how to make a queries to database few days ago and it helped me a lot. But I want ask, how to make INSERT query (like in MySQL). For example user with uid 1 have reputation with parameter 0, and i want make INSERT query and chage it on 1. Thanks for your answering.
-
Any ideas?
-
Mongodb
db.objects.update({_key:"user:1"}, {$set: {"reputation": 2}}); db.objects.update({_key:"users:reputation", "value": "1"}, {$set: {"score": 2}});
Redis
hset user:1 reputation 2 zadd users:reputation 2 1
-
Didn't work
When I do a query, got a three dots, nothing else. -
There was a typo in my original reply, I corrected them try again.
-
Thank you, you have solved the problem.