I have a problem regarding queries in InfluxDB with python.
I have the following simple code:
from influxdb import InfluxDBClient
client = InfluxDBClient(host='localhost', port=8086)
client.create_database('pyexample')
databases= client.get_list_database()
client.switch_database('pyexample')
json_body = [
{
"measurement": "brushEvents",
"tags": {
"user": "1",
"brushId": "6c89f539-71c6-490d-a28d-6c5d84c0ee2f"
},
"time": "2018-03-28T8:01:00Z",
"fields": {
"duration": 127
},
"measurement": "brushEvents",
"tags": {
"user": "Carol",
"brushId": "6c89f539-71c6-490d-a28d-6c5d84c0ee2r"
},
"time": "2018-03-28T8:01:00Z",
"fields": {
"duration": 129
},
"measurement": "brushEvents",
"tags": {
"user": "Evi",
"brushId": "6c89f539-71c6-490d-a28d-6c5d84c0ee2e"
},
"time": "2018-03-28T8:01:00Z",
"fields": {
"duration": 132
}
}
]
client.write_points(json_body)
query = client.query('SELECT * FROM "brushEvents" WHERE "user"="Carol" ')
print(query)
I am trying to get only the user Carol with all fields, but with the query above, I am only receiving an empty ResultSet({}).
What I am doing wrong? I even tried it with single quotes.
Thanks in advance for your help!