Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for mongoose 3.0.0 #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix for mongoose 3.0.0 #24

wants to merge 1 commit into from

Conversation

cbou
Copy link

@cbou cbou commented Aug 10, 2012

A small fix for mongoose 3.0.0

At the moment this code produce an error.

    var mongoose = require("mongoose");
    var db = mongoose.createConnection("mongodb://localhost/sampledb");
    var mongooseTypes = require("mongoose-types");
    mongooseTypes.loadTypes(mongoose);
/home/user/Repositories/my-mongoose-types/lib/types/url.js:14
  Url.prototype.__proto__ = SchemaTypes.String.prototype;
                                       ^
TypeError: Cannot read property 'String' of undefined
    at Object.loadType (/home/user/Repositories/my-mongoose-types/lib/types/url.js:14:40)
    at /home/user/Repositories/my-mongoose-types/lib/index.js:12:34
    at Array.forEach (native)
    at Object.loadTypes (/home/user/Repositories/my-mongoose-types/lib/index.js:10:11)
    at Object.<anonymous> (/home/user/Repositories/my-mongoose-types/t.js:4:15)
    at Module._compile (module.js:446:26)
    at Object..js (module.js:464:10)
    at Module.load (module.js:353:31)
    at Function._load (module.js:311:12)
    at Array.0 (module.js:484:10)

@cbou
Copy link
Author

cbou commented Aug 10, 2012

It would be nice to publish a new version after the fix of this issue.

Thanks.

@panta
Copy link

panta commented Aug 10, 2012

It seems we fixed this at the same time :)
I created a pull request for panta/mongoose-types@c0d87c1
that includes also a fix for missing BinaryParser and updated the test suite.
Waiting for one of the two pull requests to be included upstream, I've created an interim npm package named mongoose-3x-types.
Cheers,
Marco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants