Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"semver": "5.6.0",
"simple-git": "1.65.0"
},
"peerDependencies": {
"mongoose": ">=4.0.0"
},
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the minimum version of mongoose that you support

"scripts": {
"build": "./node_modules/babel-cli/bin/babel.js src --out-dir dist && echo '\n\\033[0;34m[+] \\033[0;32mBuild done\\033[0m'",
"build:watch": "onchange 'src/**/*.js' -i -- yarn build",
Expand Down
3 changes: 2 additions & 1 deletion src/services/has-many-getter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const _ = require('lodash');
const P = require('bluebird');
var mongooseTypes = require('mongoose').Types;
const SearchBuilder = require('./search-builder');
const Interface = require('forest-express');
const utils = require('../utils/schema');
Expand Down Expand Up @@ -49,7 +50,7 @@ function HasManyGetter(model, association, opts, params) {
return new P((resolve, reject) => {
let id = params.recordId;
if (OBJECTID_REGEXP.test(params.recordId)) {
id = opts.mongoose.Types.ObjectId(id);
id = mongooseTypes.ObjectId(id);
}

return model
Expand Down