Created
December 28, 2020 19:20
-
-
Save nkreiger/9315518677aa21e9976838203ad905e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mongo | |
import ( | |
"context" | |
mgo "go.mongodb.org/mongo-driver/mongo" | |
) | |
// ExecuteParams defines the necessary values to execute a | |
// mongo query | |
type ExecuteParams struct { | |
Context context.Context | |
Database *mgo.Database | |
Collection string | |
} | |
// QueryInputs handles the inputs that would go into a basic and advanced MQL | |
type QueryInputs struct { | |
Limit int64 `json:"limit"` | |
Projection []string `json:"projection"` | |
Sort BasicParams `json:"sort"` | |
Params BasicParams `json:"params"` | |
Update map[string]BasicParams `json:"update"` | |
ParamsWithOperations map[string][]BasicParams `json:"paramsWithOperations"` | |
} | |
// BasicParams is a subset of query inputs | |
type BasicParams map[string]interface{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment