janober / loopback-connector-couchbase-expert

Couchbase Connector for Strongloop Loopback
MIT License
2 stars 0 forks source link

forcing connector to call `bucket.get` #6

Open behrad opened 9 years ago

behrad commented 9 years ago

Excuse me if asking a generic couchbase connector here, but see your fork more active than the official: when I call .findById or .find on my model, seems couchbase uses cbquery to fetch my data and this causes a multi second delay for the find method to work right after the save (couchbase 4.0 beta) I saw a CouchbaseDB.find in the connector which is using normal get operation to fetch that id, but I don't know how to call that !?

janober commented 9 years ago

I think none of the Couchbase connectors is very active. The only changes I did recently were bugfixes. Right now have not much time and it does what I need it to do, so had no reason to update it since.

What you are describing is one of many reasons why I decided to fork. The whole N1QL stuff made everything very slow and that is why I removed it all together (it kind of negated the reason why I did decide to use Couchbase in the first place). One way around that would be to simply do what I proposed here: https://github.com/guardly/loopback-connector-couchbase/issues/7

It then checks first if an ID is given and if so it does not use cbquery.

Simply fork and then do it yourself. You can then open a PR and reference the issue, maybe it gets then merged. Until then you can use your own fork.

behrad commented 9 years ago

thank you for you response @janober

Actually I forked since current master branch isn't working in iojs which we are based on. I can't ignore n1ql, we do need flexible mongo like queries on our data, but need fast writes/updates which mongo is not capable of, but Couchbase is. I'd love to hear your comments about my case also.

I did hack using connector.myCluster for now, but will merge your PR in for sure