FB_NoSQLQueryBuilder_DocumentDB

Function block for defining a query for the database. The query is sent with FB_NoSQLQueryEvt. It is not necessary to call the Build method.
Syntax
Definition:
FUNCTION BLOCK FB_NoSQLQueryBuilder_DocumentDB
VAR_INPUT
eQueryType : E_DocumentDbQueryType;
sCollectionName : T_MAXSTRING;
pQueryOptions: POINTER TO BYTE;
cbQueryOptions : UDINT;
END_VAR
VAR_OUTPUT
END_VAR
Inputs
Name | Type | Description |
---|---|---|
eQueryType | Type of query sent to the database. | |
sCollectionName | T_ MAXSTRING | Name of the collection that is the target of the query. |
pQueryOptions | POINTER TO BYTE | Specifies the address for the query options. |
cbQueryOptionsr | UDINT | Length of the query options. |
Methods
Name | Definition location | Description |
---|---|---|
Local | [optional] This method generates a query for the function block FB_NoSQLQueryEvt from the set parameters. |
Sample:
VAR
fbNoSQLQueryBuilder_DocumentDB: FB_NoSQLQueryBuilder_DocumentDB;
sFilter : T_MAXSTRING;
stOptions : T_QueryOptionDocumentDB_Find;
END_VAR
// Set your settings before you run the query
stOptions.pFilter:= ADR(sFilter);
stOptions.cbFilter:= SIZEOF(sFilter);
fbNoSQLQueryBuilder_DocumentDB.eQueryType:=E_DocumentDbQueryType.Find;
fbNoSQLQueryBuilder_DocumentDB.sCollectionName:= 'MyCollectionName';
fbNoSQLQueryBuilder_DocumentDB.pQueryOptions:= ADR(stOptions);
fbNoSQLQueryBuilder_DocumentDB.cbQueryOptions:= SIZEOF(stOptions);
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1 Build 4022.20 | PC or CX (x86) | Tc3_Database |
Further Information