Skip to content
Snippets Groups Projects
Commit 0aa029d0 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Merge branch 'f-find-query' into 'dev'

DOC: F find query

See merge request !82
parents 10ed8e16 2bc8b188
No related branches found
No related tags found
2 merge requests!96Release 0.11.2,!82DOC: F find query
Pipeline #34596 passed
This commit is part of merge request !96. Comments created here will be created in the context of that merge request.
...@@ -60,7 +60,7 @@ it using its high level representation: ...@@ -60,7 +60,7 @@ it using its high level representation:
from caosdb.high_level_api import query from caosdb.high_level_api import query
res = query("FIND Record Experiment") res = query("FIND Experiment")
experiment = res[0] experiment = res[0]
# Use a property: # Use a property:
print(experiment.date) print(experiment.date)
...@@ -80,7 +80,7 @@ series of commands to achieve the same result: ...@@ -80,7 +80,7 @@ series of commands to achieve the same result:
import caosdb as db import caosdb as db
res = db.execute_query("FIND Record Experiment") res = db.execute_query("FIND Experiment")
output = res.get_property("output") output = res.get_property("output")
output_file = db.File(id=output.value[0].id).retrieve() output_file = db.File(id=output.value[0].id).retrieve()
print(output_file.path) print(output_file.path)
......
...@@ -69,8 +69,9 @@ Examples ...@@ -69,8 +69,9 @@ Examples
c.insert() c.insert()
# Useful for testing: wait until the user presses a key # Useful for testing: wait until the user presses a key
# Meanwhile have a look at the WebUI: You can e.g. query "FIND Test*" to view # Meanwhile have a look at the WebUI: You can e.g. query "FIND ENTITY Test*"
# all the entities created here and see the relations and links between them. # to view all the entities created here and see the relations and links
# between them.
b = input("Press any key to cleanup.") b = input("Press any key to cleanup.")
# cleanup everything after the user presses any button. # cleanup everything after the user presses any button.
c.delete() c.delete()
...@@ -25,7 +25,7 @@ However, you can also translate the examples to the data model that you have at ...@@ -25,7 +25,7 @@ However, you can also translate the examples to the data model that you have at
Let's start with a simple query. Let's start with a simple query.
>>> response = db.execute_query("FIND RECORD Guitar") >>> response = db.execute_query("FIND Guitar")
Queries work the same way as in the web interface. You simply provide the Queries work the same way as in the web interface. You simply provide the
query string to the corresponding function (``db.execute_query``). However, the result is not query string to the corresponding function (``db.execute_query``). However, the result is not
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment