Add config for objectId size (#3950)

* Add objectId config property, default to 10

* Update Config constructor

* Add test for backwards compatibility when changing objectId size
This commit is contained in:
Steven Shipton
2017-06-27 11:22:43 +01:00
committed by Natan Rolnik
parent bd6816c14c
commit 51d2dd92cb
9 changed files with 64 additions and 8 deletions

View File

@@ -187,7 +187,7 @@ RestWrite.prototype.setRequiredFieldsIfNeeded = function() {
// Only assign new objectId if we are creating new object
if (!this.data.objectId) {
this.data.objectId = cryptoUtils.newObjectId();
this.data.objectId = cryptoUtils.newObjectId(this.config.objectIdSize);
}
}
}