Skip to content

Commit c5b14a9

Browse files
Merge pull request #47 from Tejasweee/patch-1
bugfix documentation from tinydb to from tinyflux
2 parents f8d668e + 4c84169 commit c5b14a9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/source/querying-data.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Measurement Queries
2727

2828
To query for a specific measurement, the right-hand side of the ``MeasurementQuery`` should be a Python ``str``:
2929

30-
>>> from tinydb import MeasurementQuery
30+
>>> from tinyflux import MeasurementQuery
3131
>>> Measurement = MeasurementQuery()
3232
>>> db.search(Measurement == "city temperatures")
3333

@@ -36,7 +36,7 @@ Tag Queries
3636

3737
To query for tags, the *tag key* of interest takes the form of a query attribute (following the ``.``), while the *tag value* forms the right-hand side. An example to illustrate:
3838

39-
>>> from tinydb import TagQuery
39+
>>> from tinyflux import TagQuery
4040
>>> Tags = TagQuery()
4141
>>> db.search(Tags.city == "Greenwich")
4242

@@ -47,15 +47,15 @@ Field Queries
4747

4848
Similar to tags, to query for fields, the field key takes the form of a query attribute, while the field value forms the right-hand side:
4949

50-
>>> from tinydb import FieldQuery
50+
>>> from tinyflux import FieldQuery
5151
>>> Fields = FieldQuery()
5252
>>> db.search(Fields.high > 50.0)
5353

5454
This will query the database for all points with the field key of ``high`` exceeding the value of 50.0.
5555

5656
Some tag keys and field keys are not valid Python identifiers (for example, if the key contains whitespace), and can alternately be queried with string attributes:
5757

58-
>>> from tinydb import TagQuery
58+
>>> from tinyflux import TagQuery
5959
>>> Tags = TagQuery()
6060
>>> db.search(Tags["country name"] == "United States of America")
6161

@@ -64,7 +64,7 @@ Time Queries
6464

6565
To query based on time, the "right-hand side" of the ``TimeQuery`` should be a timezone-aware ``datetime`` object:
6666

67-
>>> from tinydb import TimeQuery
67+
>>> from tinyflux import TimeQuery
6868
>>> from datetime import datetime, timezone
6969
>>> Time = TimeQuery()
7070
>>> db.search(Time > datetime(2000, 1, 1, tzinfo=timezone.utc))
@@ -151,7 +151,7 @@ Compound Queries and Query Modifiers
151151

152152
TinyFlux also allows supports compound queries through the use of logical operators. This is particularly useful for time queries when a time range is needed.
153153

154-
>>> from tinydb import TimeQuery
154+
>>> from tinyflux import TimeQuery
155155
>>> from datetime import datetime, timezone
156156
>>> Time = TimeQuery()
157157
>>> q1 = Time > datetime(1990, 1, 1, tzinfo=timezone.utc)

0 commit comments

Comments
 (0)