apiargs-MongoDBCollection-method-createIndex-option.yaml 1.93 KB
Newer Older
1 2 3 4 5 6
arg_name: option
name: unique
type: boolean
description: |
  Creates a :manual:`unique </core/index-unique>` index.
interface: phpmethod
7
operation: ~
8
optional: true
9 10 11 12 13 14 15
---
source:
  file: apiargs-MongoDBCollection-common-option.yaml
  ref: collation
pre: |
  Specifies the :manual:`collation
  </reference/bson-type-comparison-order/#collation>` for the index.
16 17 18 19 20 21 22
---
arg_name: option
name: partialFilterExpression
type: array|object
description: |
  Creates a :manual:`partial </core/index-partial>` index.
interface: phpmethod
23
operation: ~
24 25 26 27 28 29 30 31
optional: true
---
arg_name: option
name: sparse
type: boolean
description: |
  Creates a :manual:`sparse </core/index-sparse>` index.
interface: phpmethod
32
operation: ~
33 34 35 36 37 38 39 40
optional: true
---
arg_name: option
name: expireAfterSeconds
type: integer
description: |
  Creates a :manual:`TTL </core/index-ttl>` index.
interface: phpmethod
41
operation: ~
42 43 44 45 46
optional: true
---
arg_name: option
name: name
type: string
47
description: |
48 49
  A name that uniquely identifies the index. By default, MongoDB creates index
  names based on the key.
50
interface: phpmethod
51
operation: ~
52 53 54 55 56
optional: true
---
arg_name: option
name: background
type: string
57
description: |
58 59 60
  Instructs MongoDB to build the index :manual:`as a background
  </core/index-creation>` process.
interface: phpmethod
61
operation: ~
62 63 64 65 66 67
optional: true
---
arg_name: option
name: 2dsphereIndexVersion
type: integer
description: |
68 69
  Specifies the :manual:`version of a 2dsphere </core/2dsphere>` index to
  create.
70

71 72
  MongoDB 2.6 introduced version 2 of 2dsphere indexes. Version 2 is the default
  version of 2dsphere indexes created in MongoDB 2.6 and later versions.
73
  ``2dsphereIndexVersion`` enables you to override the default version 2.
74
interface: phpmethod
75
operation: ~
76 77 78
optional: true
---
source:
79 80 81 82 83
  file: apiargs-MongoDBCollection-common-option.yaml
  ref: writeConcern
post: |
  This is not supported for server versions prior to 3.4 and will result in an
  exception at execution time if used.
84
...