Expected behavior
_id can be user defined for data/index restore operations
Actual/Current behavior
ignores old _id and generates new _id every time
(I am new to the api, so there may be a reason for this I haven't read about yet)
Steps to reproduce the actual/current behavior
var keystone = require('keystone');
var Types = keystone.Field.Types;
const errors = require("errors");
// ...
//json object based on default User Model entry
var backupAcc = JSON.parse('{"_id":"5d3f62bca9108026a732c9fa","logins":0,"password":"newTest","email":"mail@example.com","__v":0,"isAdmin":false,"name":{"last":"Sad","first":"Panda"}}');
//
// backupAcc['_id']='ObjectId("'+ backupAcc['_id']+'")';
backupAcc['_id']= keystone.mongoose.Types.ObjectId( backupAcc['_id']);
//
var payload ={};
payload['User'] = Array();
payload['User'][0] = backupAcc;
//
keystone.createItems(payload, { verbose: true}, function (err, stats) {
//wrong '_id' generated upon insert, delete, and insert again
Expected behavior _id can be user defined for data/index restore operations
Actual/Current behavior ignores old _id and generates new _id every time (I am new to the api, so there may be a reason for this I haven't read about yet)
Steps to reproduce the actual/current behavior
Environment Keystone 4 Node.js v12.6.0