Skip to content

Conversation

fleetingtimer
Copy link

add ListIndexed and List ListCollectionNames api

return res
}

// ListIndex returns all indexes in collection
Copy link
Collaborator

@jiangz222 jiangz222 May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo,ListIndexes

defer cursor.Close(ctx)

var indexInfos []bson.M
err = cursor.All(ctx, &indexInfos)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use options.IndexOptions to make ListIndexes and transIndexInfoToIndexModel simpler?

	var indexOptions []options.IndexOptions
	err = cursor.All(ctx, &indexOptions)
	if err != nil {
		return nil, err
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants