Reputation
1,616
Next tag badge:
96/100 score
61/20 answers
Badges
1 6 12
Newest
 Custodian
Impact
~40k people reached

2d
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
answered Do mongodb's 2dsphere index works on multidimensional coordinantes array?
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)?
Dec
1
awarded  Custodian
Dec
1
awarded  Fanatic
Nov
30
answered mongo2.6: db.serverStatus().connections nothing happened?
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
19
answered Track MongoDB users operations
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
5
answered JSON to BSON in mongoDB