Method: Moped::Query#first
- Defined in:
- lib/moped/query.rb
#first ⇒ Hash Also known as: one
Get the first matching document.
114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/moped/query.rb', line 114 def first reply = session.context.query( operation.database, operation.collection, operation.selector, fields: operation.fields, flags: operation.flags, skip: operation.skip, limit: -1 ) reply.documents.first end |