Monthly Archives: December 2016
asynchronous iteration & recursion
url https://mostafa-samir.github.io/async-iterative-patterns-pt1/ https://mostafa-samir.github.io/async-recursive-patterns-pt2/
deep populate with mysql
purpose get the sub obj by reading the db can specify the level can specify the field to be populated save the definition in mongodb -> this is kinds of meta data possible requirement just read some field -> select … Continue reading
use MySQL or MongoDB?
both has pros mysql good for joint query mongodb good for dynamic schema mongodb as cache mongodb for pictures? use both off load mysql db make some work simple by using the mongodb do not use the weird feature maybe … Continue reading
mongodb – separate document vs. embedded document
no big difference for insert and update So, separate collections are good if you need to select individual documents, need more control over querying, or have huge documents. Embedded documents are good when you want the entire document, the document … Continue reading
mongoose schema, model, document
objectId ObjectID (12 bytes HEX string) = Date (4 bytes, a timestamp value representing number of seconds since the Unix epoch) + MAC address (3 bytes) + PID (2 bytes) + Counter (3 bytes) Concept A Schema is an object … Continue reading
mongoose connection
is connection pool managed? looks yes, the default pool size is 5, can be modified by the optional parameter or the url parameter difference with the native mongo drive? how to use the connection for some query? use it directly … Continue reading
mongodb connection
MongoDB uses a new thread for each new connection. Node’s Mongoose is non-blocking and so you use one connection per app usually stack overflow http://dba.stackexchange.com/questions/37075/overview-of-how-mongodb-uses-its-various-threads In MongoDB, each host can use 10 connections which is set by MongoOptions.connectionsPerHostproperty. These connections … Continue reading
db connection
what is the db connection? channel btw. client & db server some db need to create separate thread for each connection oracle connection Connection-Handling Overview In Web Server, acceptor threads on a listen socket accept connections and put them into … Continue reading
mongodb like search
http://stackoverflow.com/questions/3305561/how-do-i-query-mongodb-with-like db.users.find({“name”: /.*m.*/}) or, similar, db.users.find({“name”: /m/}) You’re looking for something that contains “m” somewhere (SQL’s ‘%’ operator is equivalent to regexp’s ‘.*’), not something that has “m” anchored to the beginning of the string. is searching by regex expensive? … Continue reading