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

report a bug about Composite key when call remove. #345

Closed
huangyingjie opened this issue Sep 25, 2013 · 1 comment
Closed

report a bug about Composite key when call remove. #345

huangyingjie opened this issue Sep 25, 2013 · 1 comment

Comments

@huangyingjie
Copy link

Hi,
When I call business_keypages.find({..}).remove(function() {...}), an error always occurs:
{ [Error: ER_BAD_FIELD_ERROR: Unknown column 'url,domain' in 'where clause'] code: 'ER_BAD_FIELD_ERROR', index: 0 }
My Model is follow:

module.exports = function (db, cb) {
    db.define("business_keypages", {
        domain: String,
        url: String,
        description: String,
        time: String
    }, {
        cache: 12 * 3600, 
        id: [ "url", "domain" ]
    });
    return cb();
};

To find the reason, I changed id: [ "url", "domain" ] to id: ["domain" , "url" ], and the corresponding part of error log also changed to be domain,url.
The orm version is latest 2.1.2.

@dresende
Copy link
Owner

dresende commented Dec 5, 2013

I think I fixed this, just have to update mongodb driver to support the change.

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

No branches or pull requests

3 participants