Documentation
¶
Overview ¶
Package mongo provides a driver to work with the Mongo DBMS.
Authentication configuration ¶
DFI components which use MongoDB server that requires authentication must provide authentication data (user, password, method, etc.). This is done using component-specific configuration files. In general, these files contain a section with MongoDB-specific authentication data in a common format represented as JSON object.
For example, to authenticate using SCRAM-SHA-1 you must provide the following object:
{ "AuthMechanism": "SCRAM-SHA-1", "Username": "USER-NAME", "Password": "USER-PASSWORD" }
See the component's README file, the official reference, and the Go-example.
Index ¶
- Constants
- func DisableStartupPing()
- type Client
- func (mc *Client) Commit() (int64, int64, error)
- func (mc *Client) DeleteFPathPref(fso *types.FSObject) (int64, error)
- func (mc *Client) DeleteObj(fso *types.FSObject) error
- func (mc *Client) GetAIIIds(withFields []string) ([]string, error)
- func (mc *Client) GetAIIs(ids, retFields []string) (dbms.QueryResultsAII, error)
- func (mc *Client) GetObjects(ids, retFields []string) (dbms.QueryResults, error)
- func (mc *Client) LoadHostPaths(match dbms.MatchStrFunc) ([]string, error)
- func (mc *Client) ModifyAII(op dbms.DBOperator, args *dbms.AIIArgs, ids []string, add bool) (int64, int64, error)
- func (mc *Client) Query(qa *dbms.QueryArgs, retFields []string) (dbms.QueryResults, error)
- func (mc *Client) QueryAIIIds(qa *dbms.QueryArgs) ([]string, error)
- func (mc *Client) UpdateObj(fso *types.FSObject) error
- type Filter
- func (f *Filter) Append(expr ...primitive.E) *Filter
- func (f *Filter) Clone() *Filter
- func (f *Filter) Expr() bson.D
- func (f *Filter) FullText() bool
- func (f *Filter) JoinByNor() *Filter
- func (f *Filter) JoinByOr() *Filter
- func (f *Filter) JoinWithOthers(qjt queryJoinType, filters ...*Filter) *Filter
- func (f *Filter) Len() int
- func (f *Filter) NegFilter() *Filter
- func (f *Filter) SetExpr(expr primitive.D) *Filter
- func (f *Filter) SetFullText() *Filter
Constants ¶
const ( MongoFieldTFPath = "tfpath" MongoFieldTName = "tname" )
Duplicates of original fields found path and name with values transformed for tokenization
const ( MongoFieldID = "_" + dbms.FieldID MongoObjsColl = "objs" MongoAIIColl = "aii" )
Variables ¶
This section is empty.
Functions ¶
func DisableStartupPing ¶
func DisableStartupPing()
Types ¶
type Client ¶
type Client struct { *dbms.CommonClient // contains filtered or unexported fields }
func (*Client) DeleteFPathPref ¶
func (*Client) GetAIIs ¶
func (mc *Client) GetAIIs(ids, retFields []string) (dbms.QueryResultsAII, error)
func (*Client) GetObjects ¶
func (mc *Client) GetObjects(ids, retFields []string) (dbms.QueryResults, error)
func (*Client) LoadHostPaths ¶
func (mc *Client) LoadHostPaths(match dbms.MatchStrFunc) ([]string, error)
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func (*Filter) JoinWithOthers ¶
func (*Filter) NegFilter ¶
NegFilter converts list of filter conditions from:
{ { $cond1 }, { $cond2 }, { $cond3 } }
to:
{$not: $cond1 }, {$not: $cond2 }, {$not: $cond3}
but (!) Mongo does not support $not as the first-level operator, need to use $nor
{ {$nor: [{ $cond1 }] }, {$nor: [{ $cond2 }], {$nor: [{ $cond3 }]} }