-
Notifications
You must be signed in to change notification settings - Fork 3
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
Couchdb2 mango query interface #128
base: couchdb2
Are you sure you want to change the base?
Conversation
lib/dolly/mango/selector.rb
Outdated
query[SELECTOR][name][first][second] = value | ||
end | ||
|
||
def operator_value_type_check operator, value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a good idea 🎉
lib/dolly/mango/selector.rb
Outdated
end | ||
|
||
def build_not_equal_selector name, value | ||
@query[SELECTOR][name][NE_OPERATOR] = value | ||
def build_exclusive_selector name, value, operator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good! 👏
lib/dolly/document.rb
Outdated
def mango_scope scope_name, scope | ||
self.mango_scopes ||= {} | ||
name = scope_name.to_sym | ||
self.mango_scopes[name] = lambda { |query_object, args| Mango::Scope.new(query_object, scope, args)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use the new lambda syntax here
self.mango_scopes[name] = ->(query_object, args) { Mango::Scope.new query_object, scope, args }
…y into couchdb2-mango-query-interface Conflicts: lib/dolly/query.rb
The goal of this PR is to define an api for dolly documents to build mango queries as defined here http://docs.couchdb.org/en/2.0.0/api/database/find.html