mirror of
https://github.com/anyproto/docs.git
synced 2025-06-08 05:47:05 +09:00
67 lines
3.5 KiB
Markdown
67 lines
3.5 KiB
Markdown
---
|
|
description: A live search of all Objects which share a common Type or Property
|
|
---
|
|
|
|
# Queries
|
|
|
|
Lots of people compare Queries with databases, but there's a key difference: Queries don't _store_ Objects like regular databases.
|
|
|
|
Queries are a way to see a portion of your Graph, and Objects you've created, based on your filtered criteria, and several secondary filters which you can customize. You can think of them as a live filter or query for Objects which share certain criteria - specifically, a Type or a Property.
|
|
|
|
#### Queries serve two primary functions:
|
|
|
|
1. **Organizing and Accessing Objects**\
|
|
\
|
|
We often get requests along the lines of: _How do I find all of the Notes I've created?_\
|
|
\
|
|
One easy way is to create a Query based on Type.\
|
|
For example; Note, which will display every Note you've created in Anytype.\
|
|
\
|
|
If you have specific notes you'd like to frequently access, you can filter them based on Properties you've added to these notes.\
|
|
\
|
|
For instance: Creation Date, Tags, or Priority.\
|
|
\
|
|
You can then create a Widget which will appear in your Sidebar, acting like a folder for all Objects that meet certain criteria.
|
|
2. **Editing Objects**
|
|
|
|
<figure><img src="../../.gitbook/assets/image (111).png" alt="" width="563"><figcaption></figcaption></figure>
|
|
|
|
Queries also provide a way to quickly edit Objects in a list View.\
|
|
\
|
|
You can use multi-select in Queries to delete multiple Objects at once, or to batch update Properties / the Object Type of Objects. Any Properties added to a Query in the Property Menu (top right), will be adopted by all new Objects created with the "+ New Object" button.
|
|
|
|
<div><figure><img src="../../.gitbook/assets/image (90).png" alt=""><figcaption></figcaption></figure> <figure><img src="../../.gitbook/assets/image (91).png" alt=""><figcaption></figcaption></figure></div>
|
|
|
|
### Creating Queries
|
|
|
|
You can create a Query with the + button from your sidebar or using the / shortcut menu in the editor.
|
|
|
|
You'll then need to choose if you want a Query by Type which lets you list all of your Objects of a certain Type, or a Query by Property which will list all Objects that contain the Property of your choosing. 
|
|
|
|
<div><figure><img src="../../.gitbook/assets/image (112).png" alt=""><figcaption></figcaption></figure> <figure><img src="../../.gitbook/assets/image (113).png" alt=""><figcaption></figcaption></figure></div>
|
|
|
|
### Customizing Your Query
|
|
|
|
#### Toggle & Add Properties to Objects via Queries
|
|
|
|
Instead of adding Properties one-by-one to Objects, you can batch-add them to your Query by clicking the filters on the right side.
|
|
|
|
Here you can toggle on/off any Properties that you would like to see, add another Property or new Property, and edit the View of the Query here.
|
|
|
|
<figure><img src="../../.gitbook/assets/image (114).png" alt="" width="375"><figcaption></figcaption></figure>
|
|
|
|
#### Sorts & Filters
|
|
|
|
You are also able to sort or filter your Query by any Property that you've previously added to the Query.
|
|
|
|
<div><figure><img src="../../.gitbook/assets/image (119).png" alt=""><figcaption></figcaption></figure> <figure><img src="../../.gitbook/assets/image (120).png" alt=""><figcaption></figcaption></figure></div>
|
|
|
|
#### Layout
|
|
|
|
In this section you can find all the currently available layout options.
|
|
|
|
{% hint style="warning" %}
|
|
Kanban, calendar and graph views are available on desktop only.
|
|
{% endhint %}
|
|
|
|
<figure><img src="../../.gitbook/assets/image (109).png" alt="" width="375"><figcaption></figcaption></figure>
|