Convert ObjectID (Mongodb) to String in JavaScript

后端 未结 16 1341
青春惊慌失措
青春惊慌失措 2020-12-02 19:50

I want to convert ObjectID (Mongodb) to String in JavaScript. When I get a Object form MongoDB. it like as a object has: timestamp, second, inc, machine. I can\'t convert to

16条回答
  •  余生分开走
    2020-12-02 20:30

    If someone use in Meteorjs, can try:

    In server: ObjectId(507f191e810c19729de860ea)._str.

    In template: {{ collectionItem._id._str }}.

提交回复
热议问题