Error : No unix socket support on windows connecting mongodb

I had the same issue and was able to fix it by removing the full url (for example: mongodb://myuser:[email protected]/my_database) in the connection tab and only putting in the mongodb server url: mongodb-test.mydomain.com. Next, in the Authentication tab, I checked the Perform authentication checkbox, specified the Database, user name, password. I also added the database in … Read more

How do I check if an index is being used

The simplest solution to this is to use the mongodb inbuilt $indexStats aggregation stage, added in MongoDB 3.2. Using the Mongo console: db.collection.aggregate([ { $indexStats: { } } ]) Using PyMongo: from pymongo import MongoClient collection = MongoClient()[db_name][collection_name] index_stats = collection.aggregate([{‘$indexStats’:{}}]) for index_info in index_stats: print index_info

mongodb get distinct records

There is a distinct command in mongodb, that can be used in conjunction with a query. However, I believe this just returns a distinct list of values for a specific key you name (i.e. in your case, you’d only get the id values returned) so I’m not sure this will give you exactly what you … Read more

MongoDB structure: single collection vs multiple smaller collections

I would recommend NOT to make separate collection per user. Read the documentation By default MongoDB has a limit of approximately 24,000 namespaces per database. Each namespace is 628 bytes, the .ns file is 16MB by default. Each collection counts as a namespace, as does each index. Thus if every collection had one index, we … Read more

What is the recommended equivalent of cascaded delete in MongoDB for N:M relationships?

What you are doing is the best and most optimal way of doing it in Mongo. I am in a similar situation and after going all possible implementations of the N:M design pattern, have also arrived to this same solution. Apparently, This is not a mongodb thing, but more of a concept of NoSQL, wherein, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)