Before you begin

In the Cloud Console, on the project selector page,
select or create a Cloud project.

Note: If you don't plan to keep the
resources that you create in this procedure, create a project instead of
selecting an existing project. After you finish these steps, you can
delete the project, removing all resources associated with the project.

If you are not the project owner, your account requires the
following permissions to complete this quickstart:

Your account requires the
Datastore Owner role
which contains the datastore.databases.create permission
needed to create a Datastore mode instance.

Datastore mode requires an active App Engine application.
If the project doesn't have an application, this quickstart creates one
for you. In that case, you require the
appengine.applications.create permission. The project owner
can assign this permission with an
IAM custom role.

Store data

If you see the following page, you need to select a location. (Go to the next
step if you do not see this page.)

Warning: You cannot change the location after it has been
saved.

The location applies to both Datastore mode databases and App Engine apps for
your Google Cloud project.To save a location, select one of the location values and click
Next.

On the Create an entity page, use [default] for Namespace.

Type Task for Kind.

Under Properties use the Add property button to add these properties:

Name

Type

Value

Indexed

description

String

Learn Google Datastore mode

created

Date and time

(today's date)

✓

done

Boolean

False

✓

Your creation page should now look like this:

Click Create. The console displays the Task entity that you just created.

You just stored data in your database!

Run a query

Datastore mode databases support querying data by kind or by Google Query Language (GQL); the
instructions below walk you through the steps of doing both.

Run kind queries

Click Query by kind.

Select Task as the kind.

The query results show the Task entity that you created.

Next, add a query filter to restrict the results to entities that meet specific
criteria:

Click Filter entities.

In the dropdown lists, select done, is a boolean, and
that is false.

Click Apply filters. The results show the Task entity that you
created, since its done value is false.

Now try a query of done, is a boolean, and that is true. The
results do not include the Task entity that you created, because its
done value is not true.

Run GQL queries

Click Query by GQL.

Enter SELECT * FROM Task as the query. Note that Task is case sensitive.

Click Run query.

The query results show the Task entity that you created.

Tip

The GQL query editor supports autocompletion for kinds: When you
need to type a kind name, press Ctrl+Space to see a list of the available
kinds. Up to 300 alphabetically sorted kinds can appear in the list. For
better matches of kinds, type one or more characters.

Again, add a query filter to restrict the results to entities that meet
specific criteria:

Run a query such as SELECT * FROM Task WHERE done=false. Note that Task
and done are case sensitive.
The results show the Task entity that you created, since its done value is false.

Now run a query such as SELECT * FROM Task WHERE done=true. The results do
not include the Task entity that you created, because its done value is
not true.

Clean up

Click Query by kind and ensure Task is the selected kind.

Click Clear filters.

Select the Task entity that you created

Click Delete, and then confirm you want to delete the Task entity.
Once deleted, the entity is permanently removed from your database.