These are chat archives for Automattic/mongoose

25th
Jun 2017
nacq
@nacq
Jun 25 2017 00:10
Hi guys, I need to start a collection with a default document in it when my app start, what would be the proper way to do this?
Mihail
@metronom72
Jun 25 2017 09:31

@nacq Please, specify your question.

Maybe you should manually add document before start application?

Matthew Pengelly
@mcpengelly
Jun 25 2017 19:37
when inserting a large amount of records in mongo (millions of records) eventually i get MongoError: E11000 duplicate key error collection: entries index: _id_ dup key: { : "7l8hx5145ij4d44dm3” }
im generating the _ids myself using unique id generators but i still get this after like 100k records
Mihail
@metronom72
Jun 25 2017 19:39
hmm, this error will be raised if you will use built-in id?
Matthew Pengelly
@mcpengelly
Jun 25 2017 19:39
yes
it happens when i provide no _id
or when i generate myself one
or when i use _id: new ObjectId() from mongoose
i should note im trying to save millions of records so it works with smallerdata sets :/