- Cataloghi
- Import ed Export Pagine - ObjectID sostituita con ObjectId
This commit is contained in:
@@ -10,7 +10,7 @@ mongoose.level = 'F';
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
const { ObjectId } = require('mongodb');
|
||||
|
||||
|
||||
const shared_consts = require('../tools/shared_nodejs');
|
||||
@@ -24,7 +24,7 @@ const AccountSchema = new Schema({
|
||||
_id: {
|
||||
type: String,
|
||||
default: function () {
|
||||
return new ObjectID().toString();
|
||||
return new ObjectId().toString();
|
||||
},
|
||||
},
|
||||
idapp: {
|
||||
@@ -105,7 +105,7 @@ AccountSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
AccountSchema.pre('save', async function (next) {
|
||||
if (this.isNew) {
|
||||
this._id = new ObjectID().toString();
|
||||
this._id = new ObjectId().toString();
|
||||
}
|
||||
|
||||
next();
|
||||
@@ -304,7 +304,7 @@ AccountSchema.statics.getAccountByUsernameAndCircuitId = async function (idapp,
|
||||
|
||||
if (!myaccount && createifnotexist) {
|
||||
myaccount = new Account({
|
||||
_id: new ObjectID().toString(),
|
||||
_id: new ObjectId().toString(),
|
||||
idapp,
|
||||
username: (!groupname && !contocom) ? username : '',
|
||||
groupname,
|
||||
|
||||
Reference in New Issue
Block a user