Reputation
1,661
Next tag badge:
97/100 score
61/20 answers
Badges
1 6 13
Newest
 mongodb
Impact
~41k people reached

Feb
11
comment MongoDB Configuration File Locations
@PrivatMamtora Some popular open source configuration management systems include Chef, Puppet, Ansible, and SaltStack but there are a lot of options available depending on your requirements. Full-blown configuration management solutions are likely overkill if you have a straightforward production environment and a small development team, but as the team/deployment grows these tools help you automate consistent deployments.
Feb
10
comment MongoDB Configuration File Locations
What O/S are you using, and how did you install MongoDB? I'm guessing OS X + Homebrew given the config file path.
Feb
9
comment on-premise MongoDB Ops Manager Slack integration
Slack integration should be included with Ops Manager 2.0, although I'm not sure on the exact version when it was added. Given Ops Manager license is part of a commercial support subscription I would suggest raising a CS issue (if you are a current customer) or contacting your account executive if you are trialling.
Feb
5
comment MongoDB aggregate() error in server
What does your connect string look like? The "not master and slaveOk=false" error indicates you are connecting to a secondary without specifying a secondary read preference. Note: your second example has misspelt the secondaryPreferred read preference.
Feb
4
comment MongoDB too many db.eval cause my DB can't read write
What is the db.eval() code you are running? Server-side $eval adds a number of challenges (performance, scaling, security, ...), and there is likely a better way to solve your use case. You also cannot access the db object or other collections from a server-side eval. If you frequently need data from multiple collections you should consider adjusting your data model or merging the results from multiple queries in your app code.
Feb
1
comment Can mongodb disable in-memory? force fully-in-disk
How big is your working set of data and what sort of performance are you expecting? Are you limited to a single server with a total of 2GB? Most databases are likely to struggle if you are constantly paging data from disk into limited available memory; efficient queries are generally supported by indexes which are cached in-memory for speed. You might want to look into embedded databases which target devices with limited resources, but there is likely a disconnect in your expectations of working with massive data with only 2GB of memory.
Jan
25
comment MongoDB replicaSet keep 'syncing to' and only can be connect with shell
The C# driver and any client applications will need to access the replica set on the configured IP and port name (as returned by rs.conf()). The first thing a driver does after connecting to a replica set is to discover the current configuration. The driver then uses those hostnames & ports for further connections. I suspect you aren't having any problems connecting with the mongo shell because you are using a direct connection rather than a replica set connection (which specifies the replSet name and one or more hosts).
Jan
23
comment MongoDB replicaSet keep 'syncing to' and only can be connect with shell
You mention using Docker; is your C# application connecting to the same hostnames / IP addresses as configured in the replica set rs.conf() (and are all hostnames resolvable/connectable from the environment running your C# application)?
Jan
21
comment MongoDB replicaSet keep 'syncing to' and only can be connect with shell
You need to post more information, such as specific version of the C# driver you are using, a snippet of the code you are using to connect, and the exact error message / exception returned by the C# driver. If you can successfully connect using a mongo shell on the same computer, the problem is most likely with your application code or driver version.
Jan
21
comment MongoDB replicaSet keep 'syncing to' and only can be connect with shell
The syncing to message is part of normal replica set status and indicates which host a secondary is syncing from (usually the primary, but sometimes a nearer secondary in a distributed replica set). This is unrelated to connectivity problems, which are most often due to firewall or networking issues. Are you trying to connect via C# from the same computer that is able to successfully connect from the mongo shell?
Jan
20
comment MongoDB replCallbackWithGlobalLock-0. What does it mean?
What version of MongoDB are you using?
Jan
15
comment In which order does a mongodump --query executes
Dumping the latest entries in the oplog with mongodump is going to require a collection scan (i.e. paging through the full oplog and potentially evicting useful data from memory). I would look into a different backup strategy -- ideally one of the documented backup methods.
Jan
13
comment In which order does a mongodump --query executes
Yes, the oplog is a capped collection. However, the oplog is used by the replication internals for MongoDB so there are some notable differences from a non-system capped collection. In particular, there are no indexes on the oplog so the only possibly query plan is a collection scan (COLLSCAN in explain output) and your mongodump results in this case will always be returned in forward natural order (which will be insertion order for the oplog entries that are present).
Jan
13
comment In which order does a mongodump --query executes
In general, MongoDB collections are not maintained in insertion order on disk and queries that do not specify sort criteria similarly have an undefined order of results. This makes the insertion order irrelevant except in special cases such as capped collections. What is your goal in terms of dumping in insertion order? Are you working with a capped collection (or more specifically, the replication oplog)?
Nov
29
comment Multiple IPs are not getting bind in mongodb conf file
The IP address 0.0.0.0 means all IP v4 addresses (which includes 127.0.0.1). You could achieve the same outcome by not specifying any bindIp address, as "bind to all IP addresses" is the default behaviour as at MongoDB 3.2. Have you tried connecting to mongod via localhost, and if so was there any error? What are you trying to achieve with multiple IP addresses? The bindIp configuration determines what IP address(es) mongod listens on if your server has multiple addresses, but you still need to configure appropriate firewall settings.
Nov
15
comment MongoDB MMAPv1 vs WiredTiger storage engines
FYI, WiredTiger is the default storage engine starting in MongoDB 3.2: docs.mongodb.org/manual/release-notes/3.2/….
Nov
12
comment Very slow MongoDB find query
What is the average size of your documents (eg. db.observation_target.stats().avgObjSize) and what type of plan are you on at MongoLab? Perhaps at 20,000 documents you are hitting a ceiling on the resources that have been provisioned for your plan level.
Nov
1
comment Mongodb slave shut down
What specific version of MongoDB are you using, and what error did you get when the node crashed? Are you actually using the older master/slave configuration or referring to a replica set secondary?
Oct
28
comment Hash index use case in MongoDB
@MarkusWMahlberg I don't think there is a compelling argument for hash indexes as a performance win in their current form, and they won't solve your issue of avoiding duplicates in a long running query. A better (and separate) question might be around your use case of query isolation. The answer will depend on isolation guarantees provided by the storage engine as well as the deployment type. The $snapshot cursor option currently only works on a standalone mongod level because a sharded environment has external factors like document migrations between shards due to rebalancing.
Oct
28
comment Hash index use case in MongoDB
@MarkusWMahlberg The hash index in MongoDB (through 3.2) is using an MD5 digest which is a 16-byte value (as compared to a 12-byte ObjectId). Irrespective of the underlying representation, hashed indexes are currently not unique (and do not support adding a unique constraint) so this doesn't disallow the possibility of discovering a document twice in a standalone deployment (eg. due to document moves with MMAP storage engine). The order of values in an index also does not have affinity to the natural order on disk (that would be a clustered index, which isn't a feature yet).