-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter documents using Go code #370
Conversation
|
||
// ProjectDocuments modifies given documents in places according to the given projection. | ||
func ProjectDocuments(docs []*types.Document, projection *types.Document) error { | ||
// TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
|
||
// SortDocuments sorts given documents in place according to the given sorting conditions. | ||
func SortDocuments(docs []*types.Document, sort *types.Document) error { | ||
// TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
return &reply, nil | ||
return nil, fmt.Errorf("TODO") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
|
||
// ProjectDocuments modifies given documents in places according to the given projection. | ||
func ProjectDocuments(docs []*types.Document, projection *types.Document) error { | ||
// TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
MsgCreateIndexes(context.Context, *wire.OpMsg) (*wire.OpMsg, error) | ||
MsgDelete(context.Context, *wire.OpMsg) (*wire.OpMsg, error) | ||
MsgFindOrCount(context.Context, *wire.OpMsg) (*wire.OpMsg, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
"github.com/FerretDB/FerretDB/internal/wire" | ||
) | ||
|
||
// MsgFindOrCount finds documents in a collection or view and returns a cursor to the selected documents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// MsgFindOrCount finds documents in a collection or view and returns a cursor to the selected documents | |
// MsgFind finds documents in a collection or view and returns a cursor to the selected documents |
resDocs = append(resDocs, doc) | ||
} | ||
|
||
if err = common.SortDocuments(resDocs, sort); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to sort documents on count query?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Nice catch!
Documents: []*types.Document{types.MustNewDocument( | ||
"cursor", types.MustNewDocument( | ||
"firstBatch", firstBatch, | ||
"id", int64(0), // TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what TODO is meant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor support. Not for this PR
No description provided.