Skip to content

Commit b478ece

Browse files
committed
RM PR fixes 1
1 parent 2104ca7 commit b478ece

File tree

1 file changed

+69
-35
lines changed

1 file changed

+69
-35
lines changed

docs/eloquent-models/schema-builder.txt

Lines changed: 69 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,15 @@ drop various types of indexes on a collection.
157157
Create an Index
158158
~~~~~~~~~~~~~~~
159159

160-
To create indexes, call the ``create()`` method on the ``Schema`` facade
161-
in your migration file. Pass it the collection name and a callback
162-
method with a ``MongoDB\Laravel\Schema\Blueprint`` parameter. Specify the
163-
index creation details on the ``Blueprint`` instance.
160+
To create indexes, perform the following actions:
161+
162+
1. Call the ``create()`` method on the ``Schema`` facade
163+
in your migration file.
164+
165+
#. Pass it the collection name and a callback method with a
166+
``MongoDB\Laravel\Schema\Blueprint`` parameter.
167+
168+
#. Specify the index creation details on the ``Blueprint`` instance.
164169

165170
The following example migration creates indexes on the following collection
166171
fields:
@@ -262,11 +267,16 @@ indexes:
262267
- Unique indexes, which prevent inserting documents that contain duplicate
263268
values for the indexed field
264269

265-
To create these index types, call the ``create()`` method on the ``Schema`` facade
266-
in your migration file. Pass ``create()`` the collection name and a callback
267-
method with a ``MongoDB\Laravel\Schema\Blueprint`` parameter. Call the
268-
appropriate helper method on the ``Blueprint`` instance and pass the
269-
index creation details.
270+
To create these index types, perform the following actions:
271+
272+
1. Call the ``create()`` method on the ``Schema`` facade
273+
in your migration file.
274+
275+
#. Pass ``create()`` the collection name and a callback method with a
276+
``MongoDB\Laravel\Schema\Blueprint`` parameter.
277+
278+
#. Call the appropriate helper method for the index type on the
279+
``Blueprint`` instance and pass the index creation details.
270280

271281
The following migration code shows how to create a sparse and a TTL index
272282
by using the index helpers. Click the :guilabel:`{+code-output-label+}` button to see
@@ -339,10 +349,16 @@ Create a Geospatial Index
339349
In MongoDB, geospatial indexes let you query geospatial coordinate data for
340350
inclusion, intersection, and proximity.
341351

342-
To create geospatial indexes, call the ``create()`` method on the ``Schema`` facade
343-
in your migration file. Pass ``create()`` the collection name and a callback
344-
method with a ``MongoDB\Laravel\Schema\Blueprint`` parameter. Specify the
345-
geospatial index creation details on the ``Blueprint`` instance.
352+
To create geospatial indexes, perform the following actions:
353+
354+
1. Call the ``create()`` method on the ``Schema`` facade
355+
in your migration file.
356+
357+
#. Pass ``create()`` the collection name and a callback method with a
358+
``MongoDB\Laravel\Schema\Blueprint`` parameter.
359+
360+
#. Specify the geospatial index creation details on the ``Blueprint``
361+
instance.
346362

347363
The following example migration creates a ``2d`` and ``2dsphere`` geospatial
348364
index on the ``spaceports`` collection. Click the :guilabel:`{+code-output-label+}`
@@ -379,11 +395,16 @@ the {+server-docs-name+}.
379395
Drop an Index
380396
~~~~~~~~~~~~~
381397

382-
To drop indexes from a collection, call the ``table()`` method on the
383-
``Schema`` facade in your migration file. Pass it the table name and a
384-
callback method with a ``MongoDB\Laravel\Schema\Blueprint`` parameter.
385-
Call the ``dropIndex()`` method with the index name on the ``Blueprint``
386-
instance.
398+
To drop indexes from a collection, perform the following actions:
399+
400+
1. Call the ``table()`` method on the ``Schema`` facade in your
401+
migration file.
402+
403+
#. Pass it the table name and a callback method with a
404+
``MongoDB\Laravel\Schema\Blueprint`` parameter.
405+
406+
#. Call the ``dropIndex()`` method with the index name on the
407+
``Blueprint`` instance.
387408

388409
.. note::
389410

@@ -420,12 +441,16 @@ Vector Search features:
420441
Atlas Search
421442
````````````
422443

423-
To create Atlas Search indexes, call the ``create()`` method on the
424-
``Schema`` facade in your migration file. Pass ``create()`` the
425-
collection name and a callback method with a
426-
``MongoDB\Laravel\Schema\Blueprint`` parameter. Pass the Atlas index
427-
creation details to the ``searchIndex()`` method on the ``Blueprint``
428-
instance.
444+
To create Atlas Search indexes, perform the following actions:
445+
446+
1. Call the ``create()`` method on the ``Schema`` facade in your
447+
migration file.
448+
449+
#. Pass ``create()`` the collection name and a callback method with a
450+
``MongoDB\Laravel\Schema\Blueprint`` parameter.
451+
452+
#. Pass the Atlas index creation details to the ``searchIndex()`` method
453+
on the ``Blueprint`` instance.
429454

430455
This example migration creates the following Atlas Search indexes on the
431456
``galaxies`` collection:
@@ -480,12 +505,16 @@ indexes created by running the migration:
480505
Vector Search
481506
`````````````
482507

483-
To create Vector Search indexes, call the ``create()`` method on the
484-
``Schema`` facade in your migration file. Pass ``create()`` the
485-
collection name and a callback method with a
486-
``MongoDB\Laravel\Schema\Blueprint`` parameter. Pass the Atlas index
487-
creation details to the ``vectorSearchIndex()`` method on the ``Blueprint``
488-
instance.
508+
To create Vector Search indexes, perform the following actions:
509+
510+
1. Call the ``create()`` method on the ``Schema`` facade in your
511+
migration file.
512+
513+
#. Pass ``create()`` the collection name and a callback method with a
514+
``MongoDB\Laravel\Schema\Blueprint`` parameter.
515+
516+
#. Pass the vector index creation details to the ``vectorSearchIndex()``
517+
method on the ``Blueprint`` instance.
489518

490519
The following example migration creates a Vector Search index called
491520
``vs_index`` on the ``galaxies`` collection.
@@ -524,11 +553,16 @@ indexes created by running the migration:
524553
Drop a Search Index
525554
```````````````````
526555

527-
To drop an Atlas Search or Vector Search index from a collection, call
528-
the ``table()`` method on the ``Schema`` facade in your migration file.
529-
Pass it the collection name and a callback method with a
530-
``MongoDB\Laravel\Schema\Blueprint`` parameter. Call the ``dropSearchIndex()``
531-
method with the Search index name on the ``Blueprint`` instance.
556+
To drop an Atlas Search or Vector Search index from a collection,
557+
perform the following actions:
558+
559+
1. Call the ``table()`` method on the ``Schema`` facade in your migration file.
560+
561+
#. Pass it the collection name and a callback method with a
562+
``MongoDB\Laravel\Schema\Blueprint`` parameter.
563+
564+
#. Call the ``dropSearchIndex()`` method with the Search index name on
565+
the ``Blueprint`` instance.
532566

533567
The following example migration drops an index called ``auto_index``
534568
from the ``galaxies`` collection:

0 commit comments

Comments
 (0)