Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add ListIndexes and ListCollectionNames api #284

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fleetingtimer
Copy link

add ListIndexed and List ListCollectionNames api

@@ -540,6 +540,64 @@ func generateDroppedIndex(index []string) string {
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
	}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants