Skip to content

Commit

Permalink
Document strictObjectIDCorecion flag
Browse files Browse the repository at this point in the history
  • Loading branch information
loay committed Jun 22, 2017
1 parent e7c8787 commit a72faad
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,25 @@ make benchmarks

The results will be output in `./benchmarks/results.md`.

## strictObjectIDCoercion flag

In version 1.17.0, where the id is of string type, is being converted to ObjectID when the string length is 12 or 24 and has the format of an ObjectID i.e /^[0-9a-fA-F]{24}$/. To avoid this issue, the strictObjectIDCoercion flag should be set in the model-definiton file.

model-definition.js

```js
{
"name": "myModelName",
"base": "PersistedModel",
"idInjection": false,
"options": {
"validateUpsert": true,
"strictObjectIDCoercion": true
},
...
}
```

## Release notes

* 1.1.7 - Do not return MongoDB-specific _id to client API, except if specifically specified in the model definition

0 comments on commit a72faad

Please sign in to comment.