Skip to content

ITcutives/adapter-mongo

Repository files navigation

adapter-mongo

Greenkeeper badge Build Status

Unsupported

  • Like
  • Not like

Values/Changes

The adapter takes care of serialisation/deserialisation defined under

Supported Types

  • objectId
  /**
   * @returns {{}}
   */
  static get SERIALIZED() {
    return {
      "user_id": "objectId",
    };
  }

takes

let object = {
  "name": "ashish",
  "user_id": "5bfbad79df84c01b759d96e4"
};

and converts to

let object = {
  "name": "ashish",
  "user_id": ObjectId("5bfbad79df84c01b759d96e4")
};