FAQ
Hi,

I'm trying to implement a new inflection like field.gte, field.lte.

I couldn't find in the code how that is implemented.

What I want to do is this:

where(:location.near(:sphere) => { point: [ 41.23, 2.9 ], max: 20 })

to become:

:location => { "$nearSphere"=>[41.23, 2.9], "$maxDistance"=>20.0 }

Can anybody help me here?
Thanks

Search Discussions

  • Arthur Neves at Jan 15, 2013 at 4:32 pm
    I believe that what you are looking for is not on mongoid. the inflection code is part of Origin: https://github.com/mongoid/origin/blob/master/lib/origin/selectable.rb#L210

    --
    Arthur Nogueira Neves
    @arthurnn

    On Tuesday, 15 January, 2013 at 11:25 AM, azisaka wrote:

    Hi,

    I'm trying to implement a new inflection like field.gte, field.lte.

    I couldn't find in the code how that is implemented.

    What I want to do is this:

    where(:location.near(:sphere) => { point: [ 41.23, 2.9 ], max: 20 })

    to become:

    :location => { "$nearSphere"=>[41.23, 2.9], "$maxDistance"=>20.0 }

    Can anybody help me here?
    Thanks
  • Azisaka at Jan 15, 2013 at 4:54 pm
    Cool! Thank you Arthur!
    On Tuesday, January 15, 2013 2:32:24 PM UTC-2, Arthur Neves wrote:

    I believe that what you are looking for is not on mongoid. the inflection
    code is part of Origin:
    https://github.com/mongoid/origin/blob/master/lib/origin/selectable.rb#L210

    --
    Arthur Nogueira Neves
    @arthurnn

    On Tuesday, 15 January, 2013 at 11:25 AM, azisaka wrote:

    Hi,

    I'm trying to implement a new inflection like field.gte, field.lte.

    I couldn't find in the code how that is implemented.

    What I want to do is this:

    where(:location.near(:sphere) => { point: [ 41.23, 2.9 ], max: 20 })

    to become:

    :location => { "$nearSphere"=>[41.23, 2.9], "$maxDistance"=>20.0 }

    Can anybody help me here?
    Thanks

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmongoid @
categoriesmongodb, rubyonrails
postedJan 15, '13 at 4:32p
activeJan 15, '13 at 4:54p
posts3
users2
websitemongoid.org
irc#mongoid

2 users in discussion

Azisaka: 2 posts Arthur Neves: 1 post

People

Translate

site design / logo © 2022 Grokbase