Skip to content

DOCS-898 fix 2d geospatial example #501

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

Merged
merged 1 commit into from
Dec 22, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/applications/geospatial-indexes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ command. You must specify both the coordinate and other field to

.. code-block:: javascript

db.runCommand( { geoSearch: <haystack index>,
db.runCommand( { geoSearch: <collection>,
search: { <field>: <value> } } )

For example, to return all documents with the value ``restaurants`` in
Expand Down
2 changes: 1 addition & 1 deletion source/core/data-modeling.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ that:
of data.

Each document only needs to contain relevant fields to the entity or
object that the document represents. In practice, *most documents in a
object that the document represents. In practice, *most* documents in a
collection share a similar structure. Schema flexibility means that
you can model your documents in MongoDB so that they can closely
resemble and reflect application-level objects.
Expand Down
10 changes: 5 additions & 5 deletions source/core/geospatial-indexes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,16 @@ following prototype:

.. code-block:: javascript

{ _id : 100, { long : 126.9, lat : 35.2 }, type : "restaurant"}
{ _id : 200, { long : 127.5, lat : 36.1 }, type : "restaurant"}
{ _id : 300, { long : 128.0, lat : 36.7 }, type : "national park"}
{ _id : 100, pos: { long : 126.9, lat : 35.2 }, type : "restaurant"}
{ _id : 200, pos: { long : 127.5, lat : 36.1 }, type : "restaurant"}
{ _id : 300, pos: { long : 128.0, lat : 36.7 }, type : "national park"}

The following operations creates a haystack index with buckets that
store keys within 1 unit of longitude or latitude.

.. code-block:: javascript

db.mydb.ensureIndex( { pos : "geoHaystack", type : 1 }, { bucketSize : 1 } )
db.mycoll.ensureIndex( { pos : "geoHaystack", type : 1 }, { bucketSize : 1 } )

Therefore, this index stores the document with an ``_id`` field
that has the value ``200`` in two
Expand All @@ -223,7 +223,7 @@ following prototype:
1. in a bucket that includes the document where the ``_id`` field
has a value of ``100``, and

2. in a buckt that includes the document where the ``_id`` field
2. in a bucket that includes the document where the ``_id`` field
has a value of ``300``.

To query using a haystack index you use the :dbcommand:`geoSearch`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Model Embedded One-to-One Relationships Between Documents
=========================================================

.. default-domain::
.. default-domain:: mongodb

Overview
--------
Expand Down