Skip to content

near and max_distance request - mongo 2.6 #795

@dridk

Description

@dridk

Since I updated mongodb from 2.4 to 2.6, my near geo request doens't work..
From my models, I have :

class Note(Document):
    location   = PointField()

Then I try to get all notes arround a point

notes = Note.objects(location__near=location, location__max_distance=100)

I get this error

OperationFailure: database error: Can't canonicalize query: BadValue geo near accepts just one argument when querying for a GeoJSON point. Extra field found: $maxDistance: 50

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions