jxmono / crud

:fork_and_knife: CRUD for mono
MIT License
0 stars 1 forks source link

The Cursor constructor is "Object" instead of "Cursor" #28

Closed danandrei closed 10 years ago

danandrei commented 11 years ago

This breaks the find operation when we want to avoid "instance Cursor"

IonicaBizau commented 11 years ago

I fixed this in my latest commit.

Also, maybe there is another better way to check if a variable is Cursor. So, leaving this open until Mongo developers will tell us their answer.

IonicaBizau commented 11 years ago

Also, this was fixed in dev.

IonicaBizau commented 10 years ago

Christian Amor Kvalheim (@christkv) commented this (in the issue opened by @gabipetrovay ):

You should never rely on the constructor name in javascript for testing if an object is the right one. The only more or less working one is instanceof but it will break here aswell. I've done a refactoring that will make it work more or less for 1.4 but Cursor and Collection will go away in the next major release as they should never be constructed by any application.

And here are some changes.