Does Meteor return an invalid hexadecimal string error trying to create an ObjectID?

I insert some things into the database and update them elsewhere using jQuery (give me a break, I'm new), after which I will need to click it and display some user interface materials, which means getting I WOULD. So I set the identifier variable and then try and then try to use it in the click event:

...

"click .message-entry" : function (e) {
    var id = this._id || new Meteor.Collection.ObjectID(newMessageId);
    Session.set('singleMessageId', id);
},

...

Should work in principle, however I get the following error:

Uncaught Error: Invalid hexadecimal string for creating an ObjectID

A breakpoint indicates that the identifier is both the string and the identifier of the newly inserted document. What could be wrong here?

+4
source share
1

Meteor Mongo hexadecimal. Meteor, , {idGeneration: 'MONGO'} new MongoCollection() (, ) newMessageID new Mongo.ObjectID(newMessageID), newMessageID _id, insert().

+4

Source: https://habr.com/ru/post/1612319/


All Articles