所有 Datastore 模式代码示例

使用集合让一切井井有条 根据您的偏好保存内容并对其进行分类。

This page contains code samples for Firestore in Datastore mode. To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.

Add task

Creates and saves an Entity of the hypothetical type "Task"

An example of a valid inequality range filter.

Demonstrates a valid inequality range filter.

View in documentation

Build service

Build a service by using various CRUD methods.

View in documentation

Create a new Datastore admin client

Create a new Datastore admin client.

View in documentation

Datastore Example 1

Datastore Example showing setup

Datastore insert unit test example

Datastore insert unit test example

View in documentation

View in documentation

Distinct on query

Use distinct clause in a query.

View in documentation

Equality and inequality range filter

Filter range by equality and inequality.

View in documentation

Eventual consistent query read policy

Use a read policy.

Example datastore list tasks

Example datastore list tasks

Example datastore mark task done

Example datastore mark task done

Example datastore merged index query

Example datastore merged index query

View in documentation

Example datastore merged index tag queries

Example datastore merged index tag queries

View in documentation

Example datastore owner size tag query

Example datastore owner size tag query

View in documentation

Example datastore size coloration query

Example datastore size coloration query

View in documentation

Example datastore teardown

Example datastore teardown for unit testing

View in documentation

Example datastore unit test setup

Example datastore unit test setup

View in documentation

Example memcache GetEntity unit test

Example memcache GetEntity unit test

View in documentation

View in documentation

Export a copy of all or a subset of entities

Exports a copy of all or a subset of entities from Datastore to another storage system, such as Cloud Storage.

Filter array value with equality

Filter array value with equality range.

View in documentation

Filter array value with inequality range

Filter array value with inequality range.

View in documentation

Filter example - Datastore

Filter example in Datastore

View in documentation

Import admin entities to Datastore

Import admin entities to Datastore

View in documentation

Inequality sort

Inequality sort must be first. Use inequality sort constraints.

View in documentation

Inequality sort invalid because it's not first

Inequality sort must be first. Use inequality sort constraints.

View in documentation

Inequality sort invalid because it's not sorted by the same property

Inequality sort must be sorted by the same property and first. Use inequality sort constraints.

View in documentation

Invalid inequality range filter

An example of an invalid inequality range filter.

View in documentation

Key with ancestors

Make a key with ancestors.

View in documentation

Key with single parent

Make a key with a single parent.

View in documentation

View in documentation

View in documentation

View in documentation

List admin index

List indexes within a Datastore project

Merge datastore entity

Merge datastore entity

View in documentation

View in documentation

View in documentation

Property by kind query

Query property by kind.

View in documentation

View in documentation

Property filter query

Use a property filter query.

View in documentation

View in documentation

Query index

Query index using internal datastore features

View in documentation

Query on unindexed property

Use a query on an unindexed property.

View in documentation

Run projection query

Run a projection query.

View in documentation

Transactional single entity group read-only

Use a read-only transaction.