Development Team/Almanac/sugar.datastore.datastore: Difference between revisions
| Line 33: | Line 33: | ||
=== How do I provide a query to the datastore.find() method so that I can find datastore objects with a particular property? === | === How do I provide a query to the datastore.find() method so that I can find datastore objects with a particular property? === | ||
IMPORTANT | '''IMPORTANT''' Do not rely on datastore.find() method in all cases, its behaviour could be changed in future releases;<br>there is only on thing for sure: to treat jobjects that were created within activity use:<br>datastore.find({'activity_id': <activity_id>, ...}) | ||
The datastore package includes a find() helper function that allows you to find things in the datastore. Belows is a very simple example use of find where I simply search for journal entries that have a title of 'file1.txt'. I think print out the title and file path for each retreived entry. | The datastore package includes a find() helper function that allows you to find things in the datastore. Belows is a very simple example use of find where I simply search for journal entries that have a title of 'file1.txt'. I think print out the title and file path for each retreived entry. | ||