@@ -106,23 +106,24 @@ type createCollectionOptionsInternal struct {
106
106
ReplicationFactor replicationFactor `json:"replicationFactor,omitempty"`
107
107
CacheEnabled * bool `json:"cacheEnabled,omitempty"`
108
108
// Deprecated: use 'WriteConcern' instead
109
- MinReplicationFactor int `json:"minReplicationFactor,omitempty"`
110
- WriteConcern int `json:"writeConcern,omitempty"`
111
- WaitForSync bool `json:"waitForSync,omitempty"`
112
- DoCompact * bool `json:"doCompact,omitempty"`
113
- IsVolatile bool `json:"isVolatile,omitempty"`
114
- ShardKeys []string `json:"shardKeys,omitempty"`
115
- NumberOfShards int `json:"numberOfShards,omitempty"`
116
- IsSystem bool `json:"isSystem,omitempty"`
117
- Type CollectionType `json:"type,omitempty"`
118
- IndexBuckets int `json:"indexBuckets,omitempty"`
119
- KeyOptions * CollectionKeyOptions `json:"keyOptions,omitempty"`
120
- DistributeShardsLike string `json:"distributeShardsLike,omitempty"`
121
- IsSmart bool `json:"isSmart,omitempty"`
122
- SmartGraphAttribute string `json:"smartGraphAttribute,omitempty"`
123
- Name string `json:"name"`
124
- SmartJoinAttribute string `json:"smartJoinAttribute,omitempty"`
125
- ShardingStrategy ShardingStrategy `json:"shardingStrategy,omitempty"`
109
+ MinReplicationFactor int `json:"minReplicationFactor,omitempty"`
110
+ WriteConcern int `json:"writeConcern,omitempty"`
111
+ WaitForSync bool `json:"waitForSync,omitempty"`
112
+ DoCompact * bool `json:"doCompact,omitempty"`
113
+ IsVolatile bool `json:"isVolatile,omitempty"`
114
+ ShardKeys []string `json:"shardKeys,omitempty"`
115
+ NumberOfShards int `json:"numberOfShards,omitempty"`
116
+ IsSystem bool `json:"isSystem,omitempty"`
117
+ Type CollectionType `json:"type,omitempty"`
118
+ IndexBuckets int `json:"indexBuckets,omitempty"`
119
+ KeyOptions * CollectionKeyOptions `json:"keyOptions,omitempty"`
120
+ DistributeShardsLike string `json:"distributeShardsLike,omitempty"`
121
+ IsSmart bool `json:"isSmart,omitempty"`
122
+ SmartGraphAttribute string `json:"smartGraphAttribute,omitempty"`
123
+ Name string `json:"name"`
124
+ SmartJoinAttribute string `json:"smartJoinAttribute,omitempty"`
125
+ ShardingStrategy ShardingStrategy `json:"shardingStrategy,omitempty"`
126
+ Schema * CollectionSchemaOptions `json:"schema,omitempty"`
126
127
}
127
128
128
129
// CreateCollection creates a new collection with given name and options, and opens a connection to it.
@@ -195,6 +196,7 @@ func (p *createCollectionOptionsInternal) fromExternal(i *CreateCollectionOption
195
196
p .SmartGraphAttribute = i .SmartGraphAttribute
196
197
p .SmartJoinAttribute = i .SmartJoinAttribute
197
198
p .ShardingStrategy = i .ShardingStrategy
199
+ p .Schema = i .Schema
198
200
}
199
201
200
202
// // MarshalJSON converts CreateCollectionOptions into json
0 commit comments