- Fix #226
- Fix #212 , support options for Database()
- Fix #225, support whole index options for Index opetions like
Createindex()
And EnsureIndex()
Notes: from this version, use Unique
、Background
、Sparse
and ExpireAfterSeconds
in options.IndexOptions
instead of IndexModel
type IndexModel struct {
Key []string // Index key fields; prefix name with dash (-) for descending order
*options.IndexOptions
}
example:
indexOpts := officialOpts.Index()
indexOpts.SetUnique(true).SetExpireAfterSeconds(expireS)
ast.NoError(cli.CreateOneIndex(context.Background(), options.IndexModel{Key: unique, IndexOptions: indexOpts}))