undfinded _id for couchDB, 33 symbols ID generator

This commit is contained in:
Daniel Beilinson 2012-10-29 01:43:52 +04:00
parent 7e471407a3
commit 7a12003a35

View File

@ -485,11 +485,11 @@ _createDocument = function (new_doc, dataset) {
if (dataset.record_create)
new_doc = dataset.record_create(new_doc);
if (_id !== 1) {
if (_id !== 1 && _id !== undefined) {
new_doc['_id'] = _id;
}
else {
new_doc['_id'] = randomId(16, '#a');
new_doc['_id'] = randomId(32, '#a');
}
dfd.resolve(cdb.upsert(new_doc));