Giter Club home page Giter Club logo

Comments (10)

djc avatar djc commented on August 30, 2024

Hey, thanks for the notice. I haven't installed CouchDB 2 yet, but will likely do so soon after release. Still, I'm not sure adding APIs for Mango will be a high priority for me, personally, so it would be great if you're able to contribute some code towards this goal.

from couchdb-python.

adrian-the-git avatar adrian-the-git commented on August 30, 2024

Just thought I'd chime in that without some mango support, there will be no way to perform a query without creating a view, as they've removed temporary views in favor of this new json-based query system.

from couchdb-python.

danballance avatar danballance commented on August 30, 2024

I'm new to CouchDB and this project but I'm looking at trying to add these new functions mango_query and mango_index. If I have any success I'll submit a pull request.

from couchdb-python.

 avatar commented on August 30, 2024

A Mango query is just a POST request to /:db/_find containing some JSON in the body, so this shouldn't be hard to make, right?

from couchdb-python.

mraygalaxy avatar mraygalaxy commented on August 30, 2024

Honestly, this was really dead simple to monkeypatch:

_, _, data = db.resource.post_json('_find', body={"selector" : query}, headers = {'Content-Type': 'application/json'})
return data["docs"]

Almost nearly a one-liner. Anybody wanna make a PR?

from couchdb-python.

pirr avatar pirr commented on August 30, 2024

Maybe like in django:
For example:

data1 = db.find(field__eq='A', limit=50)
data2 = db.find(Q(field__eq='A')
                & (Q(field1__subfield1__in=['lama', 'amal'])
                    | Q(field2__subfield2__regex ="foo")), limit=40, fields=['field1', 'field2'])

I have implementation of this. If it is acceptable, I can provide my implementation.
Q obj - https://github.com/pirr/alt_couch/blob/c690771f729c38ac39041d4fea981b44623a0748/_libs/vb/couch.py#L14
find method - https://github.com/pirr/alt_couch/blob/c690771f729c38ac39041d4fea981b44623a0748/_libs/vb/couch.py#L222
Sorry for my terrible english.

from couchdb-python.

djc avatar djc commented on August 30, 2024

I would like to add an implementation to CouchDB-Python. If you can provide one that fits into the library and has comments in English, I could probably review it.

from couchdb-python.

pirr avatar pirr commented on August 30, 2024

I added filter method (mango query) with comments:
pirr@6f051bc

from couchdb-python.

djc avatar djc commented on August 30, 2024

Looks pretty good, do you want to do a pull request for this?

from couchdb-python.

pirr avatar pirr commented on August 30, 2024

#324 this is my first pool reguest. If there are comments, please, I will correct

from couchdb-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.