@@ -13,8 +13,8 @@ are *not for production use* under any circumstances.
13
13
document are subject to change before the 2.4.0 release.
14
14
15
15
This document will eventually contain the full release notes for
16
- MongoDB 2.4; during the development cycle this document will contain
17
- documentation of new features and functionality only available in the
16
+ MongoDB 2.4; during the development cycle this document will containd
17
+ ocumentation of new features and functionality only available in the
18
18
2.3 releases.
19
19
20
20
.. contents:: See the :doc:`full index of this page <2.4-changes>` for
@@ -177,7 +177,7 @@ with the following command:
177
177
178
178
.. code-block:: javascript
179
179
180
- db.collection.ensureIndex( { username: "1" ,
180
+ db.collection.ensureIndex( { username: 1 ,
181
181
"users.profiles": "text" } )
182
182
183
183
If you create an ascending or descending index as a prefix of a
@@ -197,7 +197,7 @@ following index:
197
197
.. code-block:: javascript
198
198
199
199
db.collection.ensureIndex( { "users.profiles": "text",
200
- username: "1" } )
200
+ username: 1 } )
201
201
202
202
Finally, you may use the special wild card field name specifier
203
203
(i.e. ``$**``) to specify index weights and fields. Consider the
@@ -206,7 +206,7 @@ following:
206
206
.. code-block:: javascript
207
207
208
208
db.collection.ensureIndex( { "$**": "text",
209
- username: "1" },
209
+ username: 1 },
210
210
{ name: "TextIndex" } )
211
211
212
212
This creates an index named ``TextIndex``, that indexes all string
@@ -263,17 +263,18 @@ cursor.
263
263
264
264
.. code-block:: javascript
265
265
266
- db.collection.runCommand( text: { search: <search string>,
267
- filter: <query document>,
268
- projection: <projection document>,
269
- limit: <number> } )
266
+ db.collection.runCommand( " text" : { search: <search string>,
267
+ filter: <query document>,
268
+ projection: <projection document>,
269
+ limit: <number> } )
270
270
271
271
The :dbcommand:`text` command has the following parameters:
272
272
273
273
:param string query:
274
274
275
275
A text string that MongoDB stems and uses to query the ``text``
276
- index.
276
+ index. When specifying phrase matches, you must escape quote
277
+ characters (i.e. ``"``) with backslashes (i.e. ``\``).
277
278
278
279
:param document filter:
279
280
@@ -311,7 +312,6 @@ cursor.
311
312
- :dbcommand:`text` adds all negations to the query with the
312
313
logical ``AND`` operator.
313
314
314
-
315
315
.. example::
316
316
317
317
Consider the following examples of :dbcommand:`text` queries. All
0 commit comments