Skip to content

Commit 95ea7e0

Browse files
committed
wip
1 parent 7efe5b1 commit 95ea7e0

File tree

1 file changed

+159
-159
lines changed

1 file changed

+159
-159
lines changed

docs/eloquent-models/schema-builder.txt

Lines changed: 159 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ following changes to perform the schema changes on your MongoDB database:
7676
specifies the correct database:
7777

7878
- Make sure your ``connections`` array item contains a valid ``mongodb``
79-
entry in your ``config/database.php`` file
79+
entry in your ``config/database.php`` file
8080
- Specify ``"mongodb"`` in the ``$connection`` field of your migration class
8181

8282
The following example migration class contains the following methods:
@@ -175,30 +175,30 @@ the migration, including the default index on the ``_id`` field:
175175
.. io-code-block::
176176

177177
.. input:: /includes/schema-builder/flights_migration.php
178-
:language: php
179-
:dedent:
180-
:start-after: begin create index
181-
:end-before: end create index
178+
:language: php
179+
:dedent:
180+
:start-after: begin create index
181+
:end-before: end create index
182182

183183
.. output::
184-
:language: json
185-
:visible: false
186-
187-
[
188-
{ v: 2, key: { _id: 1 }, name: '_id_' },
189-
{ v: 2, key: { mission_type: 1 }, name: 'mission_type_1' },
190-
{
191-
v: 2,
192-
key: { launch_location: 1, launch_date: -1 },
193-
name: 'launch_location_1_launch_date_-1'
194-
},
195-
{
196-
v: 2,
197-
key: { mission_id: 1 },
198-
name: 'unique_mission_id_idx',
199-
unique: true
200-
}
201-
]
184+
:language: json
185+
:visible: false
186+
187+
[
188+
{ v: 2, key: { _id: 1 }, name: '_id_' },
189+
{ v: 2, key: { mission_type: 1 }, name: 'mission_type_1' },
190+
{
191+
v: 2,
192+
key: { launch_location: 1, launch_date: -1 },
193+
name: 'launch_location_1_launch_date_-1'
194+
},
195+
{
196+
v: 2,
197+
key: { mission_id: 1 },
198+
name: 'unique_mission_id_idx',
199+
unique: true
200+
}
201+
]
202202

203203
Specify Index Options
204204
~~~~~~~~~~~~~~~~~~~~~
@@ -215,35 +215,35 @@ field:
215215
.. io-code-block::
216216

217217
.. input:: /includes/schema-builder/passengers_migration.php
218-
:language: php
219-
:dedent:
220-
:start-after: begin index options
221-
:end-before: end index options
218+
:language: php
219+
:dedent:
220+
:start-after: begin index options
221+
:end-before: end index options
222222

223223
.. output::
224-
:language: json
225-
:visible: false
226-
227-
[
228-
{ v: 2, key: { _id: 1 }, name: '_id_' },
229-
{
230-
v: 2,
231-
key: { last_name: 1 },
232-
name: 'passengers_collation_idx',
233-
collation: {
234-
locale: 'de@collation=phonebook',
235-
caseLevel: false,
236-
caseFirst: 'off',
237-
strength: 3,
238-
numericOrdering: true,
239-
alternate: 'non-ignorable',
240-
maxVariable: 'punct',
241-
normalization: false,
242-
backwards: false,
243-
version: '57.1'
244-
}
245-
}
246-
]
224+
:language: json
225+
:visible: false
226+
227+
[
228+
{ v: 2, key: { _id: 1 }, name: '_id_' },
229+
{
230+
v: 2,
231+
key: { last_name: 1 },
232+
name: 'passengers_collation_idx',
233+
collation: {
234+
locale: 'de@collation=phonebook',
235+
caseLevel: false,
236+
caseFirst: 'off',
237+
strength: 3,
238+
numericOrdering: true,
239+
alternate: 'non-ignorable',
240+
maxVariable: 'punct',
241+
normalization: false,
242+
backwards: false,
243+
version: '57.1'
244+
}
245+
}
246+
]
247247

248248
To learn more about index options, see :manual:`Options for All Index Types </reference/method/db.collection.createIndex/#options-for-all-index-types>`
249249
in the {+server-docs-name+}.
@@ -276,25 +276,25 @@ the ``_id`` field:
276276
.. io-code-block::
277277

278278
.. input:: /includes/schema-builder/planets_migration.php
279-
:language: php
280-
:dedent:
281-
:start-after: begin index helpers
282-
:end-before: end index helpers
279+
:language: php
280+
:dedent:
281+
:start-after: begin index helpers
282+
:end-before: end index helpers
283283

284284
.. output::
285-
:language: json
286-
:visible: false
287-
288-
[
289-
{ v: 2, key: { _id: 1 }, name: '_id_' },
290-
{ v: 2, key: { rings: 1 }, name: 'rings_1', sparse: true },
291-
{
292-
v: 2,
293-
key: { last_visible_dt: 1 },
294-
name: 'last_visible_dt_1',
295-
expireAfterSeconds: 86400
296-
}
297-
]
285+
:language: json
286+
:visible: false
287+
288+
[
289+
{ v: 2, key: { _id: 1 }, name: '_id_' },
290+
{ v: 2, key: { rings: 1 }, name: 'rings_1', sparse: true },
291+
{
292+
v: 2,
293+
key: { last_visible_dt: 1 },
294+
name: 'last_visible_dt_1',
295+
expireAfterSeconds: 86400
296+
}
297+
]
298298

299299
You can specify sparse, TTL, and unique indexes on either a single field or
300300
compound index by specifying them in the index options.
@@ -307,26 +307,26 @@ field:
307307
.. io-code-block::
308308

309309
.. input:: /includes/schema-builder/planets_migration.php
310-
:language: php
311-
:dedent:
312-
:start-after: begin multi index helpers
313-
:end-before: end multi index helpers
310+
:language: php
311+
:dedent:
312+
:start-after: begin multi index helpers
313+
:end-before: end multi index helpers
314314

315315
.. output::
316-
:language: json
317-
:visible: false
318-
319-
[
320-
{ v: 2, key: { _id: 1 }, name: '_id_' },
321-
{
322-
v: 2,
323-
key: { last_visible_dt: 1 },
324-
name: 'last_visible_dt_1',
325-
unique: true,
326-
sparse: true,
327-
expireAfterSeconds: 3600
328-
}
329-
]
316+
:language: json
317+
:visible: false
318+
319+
[
320+
{ v: 2, key: { _id: 1 }, name: '_id_' },
321+
{
322+
v: 2,
323+
key: { last_visible_dt: 1 },
324+
name: 'last_visible_dt_1',
325+
unique: true,
326+
sparse: true,
327+
expireAfterSeconds: 3600
328+
}
329+
]
330330

331331
To learn more about these indexes, see :manual:`Index Properties </core/indexes/index-properties/>`
332332
in the {+server-docs-name+}.
@@ -351,25 +351,25 @@ default index on the ``_id`` field:
351351

352352
.. io-code-block::
353353
.. input:: /includes/schema-builder/spaceports_migration.php
354-
:language: php
355-
:dedent:
356-
:start-after: begin create geospatial index
357-
:end-before: end create geospatial index
354+
:language: php
355+
:dedent:
356+
:start-after: begin create geospatial index
357+
:end-before: end create geospatial index
358358

359359
.. output::
360-
:language: json
361-
:visible: false
360+
:language: json
361+
:visible: false
362362

363-
[
364-
{ v: 2, key: { _id: 1 }, name: '_id_' },
365-
{
366-
v: 2,
367-
key: { launchpad_location: '2dsphere' },
368-
name: 'launchpad_location_2dsphere',
369-
'2dsphereIndexVersion': 3
370-
},
371-
{ v: 2, key: { runway_location: '2d' }, name: 'runway_location_2d' }
372-
]
363+
[
364+
{ v: 2, key: { _id: 1 }, name: '_id_' },
365+
{
366+
v: 2,
367+
key: { launchpad_location: '2dsphere' },
368+
name: 'launchpad_location_2dsphere',
369+
'2dsphereIndexVersion': 3
370+
},
371+
{ v: 2, key: { runway_location: '2d' }, name: 'runway_location_2d' }
372+
]
373373

374374

375375
To learn more about geospatial indexes, see
@@ -439,43 +439,43 @@ indexes created by running the migration:
439439
.. io-code-block::
440440

441441
.. input:: /includes/schema-builder/galaxies_migration.php
442-
:language: php
443-
:dedent:
444-
:start-after: begin-create-search-indexes
445-
:end-before: end-create-search-indexes
442+
:language: php
443+
:dedent:
444+
:start-after: begin-create-search-indexes
445+
:end-before: end-create-search-indexes
446446

447447
.. output::
448-
:language: json
449-
:visible: false
450-
451-
{
452-
"id": "...",
453-
"name": "dynamic_index",
454-
"type": "search",
455-
"status": "READY",
456-
"queryable": true,
457-
"latestDefinition": {
458-
"mappings": { "dynamic": true }
459-
},
460-
...
461-
}
462-
{
463-
"id": "...",
464-
"name": "auto_index",
465-
"type": "search",
466-
"status": "READY",
467-
"queryable": true,
468-
"latestDefinition": {
469-
"mappings": {
470-
"fields": { "name": [
471-
{ "type": "string", "analyzer": "lucene.english" },
472-
{ "type": "autocomplete", "analyzer": "lucene.english" },
473-
{ "type": "token" }
474-
] }
475-
}
476-
},
477-
...
478-
}
448+
:language: json
449+
:visible: false
450+
451+
{
452+
"id": "...",
453+
"name": "dynamic_index",
454+
"type": "search",
455+
"status": "READY",
456+
"queryable": true,
457+
"latestDefinition": {
458+
"mappings": { "dynamic": true }
459+
},
460+
...
461+
}
462+
{
463+
"id": "...",
464+
"name": "auto_index",
465+
"type": "search",
466+
"status": "READY",
467+
"queryable": true,
468+
"latestDefinition": {
469+
"mappings": {
470+
"fields": { "name": [
471+
{ "type": "string", "analyzer": "lucene.english" },
472+
{ "type": "autocomplete", "analyzer": "lucene.english" },
473+
{ "type": "token" }
474+
] }
475+
}
476+
},
477+
...
478+
}
479479

480480
Vector Search
481481
`````````````
@@ -495,31 +495,31 @@ indexes created by running the migration:
495495

496496
.. io-code-block::
497497
.. input:: /includes/schema-builder/galaxies_migration.php
498-
:language: php
499-
:dedent:
500-
:start-after: begin-create-vs-index
501-
:end-before: end-create-vs-index
498+
:language: php
499+
:dedent:
500+
:start-after: begin-create-vs-index
501+
:end-before: end-create-vs-index
502502

503503
.. output::
504-
:language: json
505-
:visible: false
506-
507-
{
508-
"id": "...",
509-
"name": "vs_index",
510-
"type": "vectorSearch",
511-
"status": "READY",
512-
"queryable": true,
513-
"latestDefinition": {
514-
"fields": [ {
515-
"type": "vector",
516-
"numDimensions": 4,
517-
"path": "vector4",
518-
"similarity": "cosine"
519-
} ]
520-
},
521-
...
522-
}
504+
:language: json
505+
:visible: false
506+
507+
{
508+
"id": "...",
509+
"name": "vs_index",
510+
"type": "vectorSearch",
511+
"status": "READY",
512+
"queryable": true,
513+
"latestDefinition": {
514+
"fields": [ {
515+
"type": "vector",
516+
"numDimensions": 4,
517+
"path": "vector4",
518+
"similarity": "cosine"
519+
} ]
520+
},
521+
...
522+
}
523523

524524
Drop a Search Index
525525
```````````````````

0 commit comments

Comments
 (0)