Skip to content

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

Description

@huangyingjie

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions