amco / dolly

Not an ORM for CouchDB in rails.
8 stars 3 forks source link

Feature/mango #143

Closed ErickFabian closed 5 years ago

ErickFabian commented 5 years ago

Adds base mango querys for dolly documents

Pending Work:

Mango query indexes

Working example

> query = {and: [{ _id: { eq: 'user/+04diego@gmail.com' } } , { first_name: { eq: 'Diego'}} ]}
=> {:and=>[{:_id=>{:eq=>"user/+04diego@gmail.com"}}, {:first_name=>{:eq=>"Diego"}}]}
> User.where(query)
=> [#<User:0x00007fb70f371ec8 @doc={:_id=>"user/+04diego@gmail.com", :username=>"ErickFabian", :email=>"+04diego@gmail.com", :first_name=>"Diego", :last_name=>"Torres"}, @username="ErickFabian", @email="+04diego@gmail.com", @first_name="Diego", @last_name="Torres">]
> query = {and: [{ _id: { eq: 'user/+04diego@gmail.com' } } , { first_name: { eeq: 'Diego'}} ]}
=> {:and=>[{:_id=>{:eq=>"user/+04diego@gmail.com"}}, {:first_name=>{:eeq=>"Diego"}}]}
> User.where(query)
Traceback (most recent call last):
        1: from (irb):4
RuntimeError (invalid operator eeq)
brlanier commented 5 years ago

Did you see the work Sean had started here - https://github.com/amco/dolly/pull/128

javierg commented 5 years ago

Did you see the work Sean had started here - #128

Ah, right... that was done for Dolly 2.x, 3.x is a different basecode, still @ErickFabian take a look and see if there is something that can help us.

ErickFabian commented 5 years ago

@javierg Yeah i'll take a look at it, this seems like a different approach but i'll look into integrating it

brlanier commented 5 years ago

@javierg Yeah i'll take a look at it, this seems like a different approach but i'll look into integrating it

I don't remember the details, but Sean worked hard to create some pattern or something that was going to make building queries easier. He was pretty excited about it at the time. I can't comment on whether it was good, bad or helpful. I just remember he put a fair amount of work into it, so it would be a shame to see it wasted.

javierg commented 5 years ago

I don't remember the details, but Sean worked hard to create some pattern or something that was going to make building queries easier. He was pretty excited about it at the time. I can't comment on whether it was good, bad or helpful. I just remember he put a fair amount of work into it, so it would be a shame to see it wasted.

Yes we will look at it, and see to integrate the query pattern, this PR is simply using the default JSON query lang from Mango, this will allow us to start working, later we can implement Seans API, unfortunately , Dolly 1 and 2 code has some fundamental issues with performance and architecture that makes that code incompatible with current Dolly 3

brlanier commented 5 years ago

I don't remember the details, but Sean worked hard to create some pattern or something that was going to make building queries easier. He was pretty excited about it at the time. I can't comment on whether it was good, bad or helpful. I just remember he put a fair amount of work into it, so it would be a shame to see it wasted.

Yes we will look at it, and see to integrate the query pattern, this PR is simply using the default JSON query lang from Mango, this will allow us to start working, later we can implement Seans API, unfortunately , Dolly 1 and 2 code has some fundamental issues with performance and architecture that makes that code incompatible with current Dolly 3

So Dolly 3 will be faster??? Sweet!!!

javierg commented 5 years ago

So Dolly 3 will be faster??? Sweet!!!

A little faster, but it retains a lot less objects in memory... and I mean A LOT LESS!

brlanier commented 5 years ago

So Dolly 3 will be faster??? Sweet!!!

A little faster, but it retains a lot less objects in memory... and I mean A LOT LESS!

ohhhhhhh I will take that over the speed.... memory is always the issue in the apps and its usually because of large queries holding memory.

seancookr commented 4 years ago

👏 I miss couch

brlanier commented 4 years ago

👏 I miss couch

It's here.... waiting for you....It misses you to @seancookr