Skip to content

Commit

Permalink
Update boot script
Browse files Browse the repository at this point in the history
  • Loading branch information
loay committed Jun 22, 2017
1 parent 29371f6 commit 0434604
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ 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 to true in the model-definition file.
In version 1.17.0, where the id 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 to true in the model-definition file.

model-definition.js

Expand All @@ -207,13 +207,13 @@ var util = require('util');

module.exports = function(app) {
var db = app.dataSources.mongoDs;
var Employee = app.models.Employee;
var myModelName = app.models.myModelName;

db.automigrate(function(err) {
if (err) throw err;
console.log('Automigrate complete');

Employee.create([{
myModelName.create([{
id: '59460487e9532ae90c324b59',
name: 'Bob',
}, {
Expand All @@ -228,9 +228,9 @@ module.exports = function(app) {
name: 'Bar',
}], function(err, result) {
if (err) throw err;
console.log('\nCreated employees: ' + util.inspect(result, 4));
console.log('\nCreated instances of my model: ' + util.inspect(result, 4));

Employee.find({where: {id: {inq: ['59460487e9532ae90c324b59',
myModelName.find({where: {id: {inq: ['59460487e9532ae90c324b59',
'59460487e9532ae90c324b5a']}}},
function(err, result) {
if (err) throw err;
Expand Down

0 comments on commit 0434604

Please sign in to comment.