Hot answers tagged

2

This question is for Linux, but for fellow windows users who found their way here and want a windows solution... the problem is your Mongodb service is stopped. So do the following steps: 1) cntrl-alt-del and open your task manager 2) click on 'services' 3) scroll down to MongoDB 4) right click and hit 'start' (or 'restart') go back to ...


1

You can use MongoDB's Aggregation Pipeline to add calculated or constant fields to a query. The $addFields stage appends new fields to existing result documents if you don't want to specify a list of all fields. However, since your example projects a subset of fields you can also add new fields using expressions in a $project stage. Your find() query would ...


1

my question is to know if this is feasible A shard key index cannot be multi key, text, or geospatial, so part of your theoretical approach is definitely infeasible. You also mention considering hashed sharding on a datetime field, which could provide better data distribution for otherwise monotonically increasing values like a timestamp. However, a ...


1

Just to clarify in case someone stumbles upon this in the future. MongoDB Replicasets need a majority vote to elect a primary. So uneven amount of nodes are advised because a 4 member replica set requires 3 votes as well as a 5 member replica set. But with a 5 member replica set 2 members can go down while with 4 only 1 can go down before the replica set ...


1

I had the same issue when i cloned a VM to make the arbiter. Similar to what aldwinaldwin said, I had to change the ip address in this line in my /etc/hosts file "192.168.1.103 mongodb-arbiter.domain.local mongodb1-arbiter" to match the ip address of the server.


Only top voted, non community-wiki answers of a minimum length are eligible