- Cataloghi
- Import ed Export Pagine - ObjectID sostituita con ObjectId
This commit is contained in:
@@ -6,7 +6,7 @@ mongoose.level = 'F';
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
const { ObjectId } = require('mongodb');
|
||||
|
||||
const { Movement } = require('../models/movement');
|
||||
const { Account } = require('../models/account');
|
||||
@@ -26,7 +26,7 @@ const CircuitSchema = new Schema({
|
||||
_id: {
|
||||
type: String,
|
||||
default: function () {
|
||||
return new ObjectID().toString();
|
||||
return new ObjectId().toString();
|
||||
},
|
||||
},
|
||||
idapp: {
|
||||
@@ -233,7 +233,7 @@ const CircuitSchema = new Schema({
|
||||
|
||||
CircuitSchema.pre('save', async function (next) {
|
||||
if (this.isNew) {
|
||||
this._id = new ObjectID().toString();
|
||||
this._id = new ObjectId().toString();
|
||||
|
||||
this.date_created = new Date();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user