Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-3163

"no geo index :(" error

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.1.5
    • Affects Version/s: None
    • Component/s: None
    • None

      Steps to reproduce:

      class Venue
      field :coordinates, type: Array
      index(

      {coordinates: '2d'}

      ,

      {min: -180, max: 180}

      )
      end

      Have ran rake db:mongoid:create_indexes

      Tried calling:

      Venue.geo_near([@lat, @long])

      And got:

      Moped::Errors::OperationFailure:
      The operation: #<Moped::Protocol::Command
      @length=135
      @request_id=3
      @response_to=0
      @op_code=2004
      @flags=[]
      @full_collection_name="encore_backend_test.$cmd"
      @skip=0
      @limit=-1
      @selector={:geoNear=>"venues", :near=>[43.670906, -79.393331], :query=>{}, :spherical=>true}
      @fields=nil>
      failed with error "no geo index "

      Any suggestions?

            Assignee:
            Unassigned Unassigned
            Reporter:
            stevenheidel stevenheidel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: