https://stackoverflow.com/questions/25725019/how-do-i-format-a-date-as-iso-8601-in-moment-js
moment.toISOString();
it will return 2018-06-27T05:55:46.055Z
moment.toISOString();
it will return 2018-06-27T05:55:46.055Z
Replication: A replica set in MongoDB is a group of mongod processes that maintain the same data set.Sharding: Sharding is a method for storing data across multiple machines.
Shards store the data. To provide high availability and data consistency, in a production sharded cluster, each shard is a replica set
user_name
, your shard-key should include the field user_name
so each query can be delegated to only the one shard which has that document). Sharded Cluster
/ | \
Shard A Shard B Shard C
/ \ / \ / \
+-------+ +---------+ +-------+ +---------+ +-------+ +---------+
|Primary| |Secondary| |Primary| |Secondary| |Primary| |Secondary|
| 25GB |=| 25GB | | 25 GB |=| 25 GB | | 25GB |=| 25GB |
+-------+ +---------+ +-------+ +---------+ +-------+ +---------+