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

Error on findeOne operation. #18

Open
luislinietsky opened this issue May 31, 2016 · 1 comment
Open

Error on findeOne operation. #18

luislinietsky opened this issue May 31, 2016 · 1 comment

Comments

@luislinietsky
Copy link

Hi,

First of all, I updated couchbase package dependency to lattest version (2.1.6), so I could connect to couchbase 4.1,

However, I am having some trouble, for any findOne(query, cb) operation, the expected result object is returned within an other object under a property labeled with the bucket's name

For example, if I call for:

app.models.User.findOne({email:"[email protected]"}, function(err, myUser){...}

The returned value for myUser is:
{ test: { docType: 'User', email: '[email protected]', firstname: 'abc', id: '2a952453-e982-489c-9c39-883ee3e01a71', lastname: 'abc', password: '$2a$10$qkl23WhsrL3Z0kmtsfKqZO4FaQQUh6NUvkpbnrUL.6LwkChRyUj82', username: 'abc' } }

where test is the name of the bucket.

I found this error while debugging the login operation from the default user model. The hasPassword method failed because the "this.password" was undefined, since the password was actualy under this.test.password", but this is not how it should be.

Just to mention it, if I try an other datasource this works just fine.

Any suggestions on how to fix this?

Regards,
Luis

@luislinietsky
Copy link
Author

Also, if I just ran a find(...), each row from the result will be like that:
[ {myBucketName: <expected_row>}, ... ]

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

No branches or pull requests

1 participant