...
Code Block |
---|
#PARSER PQL #RUNQUERY timer = TIMER({ period = 1000, source = 'timersource' } ) Map1 = MAP({EXPRESSIONS = ['time','kvwrite("test2","Time",time)','kvread("test2", "Time")']}, timer) |
For easier handling, there are also operators that allow to read different datatypes from store and avoid casting in MAP, as the default return value of the kvread method is Object:
- kvReadBool
- kvReadLong
- kvReadDouble
- kvReadString
Important: This read operations make no type conversion! So if you call kvReadBool and the value is a String, there could be Problems when using this value later.
You could also use an operator to write to an existing store:
...
As in other cases, when omitting the STORENAME the users default store is used.
For special cases, there is a new function, that can read a string from file into a store:
Code Block |
---|
#CREATE_KV_STORE query_store MemoryStore (createOnlyIfNotExists=false)
#KV_STORE_WRITE_FROM_FILE query_store 0 ${PROJECTPATH}/SimpleQuery_0.qry
#KV_STORE_WRITE_FROM_FILE query_store 1 ${PROJECTPATH}/SimpleQuery_1.qry |