Skip to content

Commit

Permalink
feat(firestore): add IN, ARRAY_CONTAINS_ANY operators; update doc…
Browse files Browse the repository at this point in the history
…strings (via synth) (#9439)
  • Loading branch information
yoshi-automation authored and tseaver committed Oct 10, 2019
1 parent 250024c commit 107e526
Show file tree
Hide file tree
Showing 8 changed files with 219 additions and 170 deletions.
22 changes: 11 additions & 11 deletions google/cloud/firestore_admin_v1/proto/operation.proto
Expand Up @@ -162,17 +162,6 @@ message ExportDocumentsResponse {
string output_uri_prefix = 1;
}

// Describes the progress of the operation.
// Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1.Progress]
// is used.
message Progress {
// The amount of work estimated.
int64 estimated_work = 1;

// The amount of work completed.
int64 completed_work = 2;
}

// Describes the state of the operation.
enum OperationState {
// Unspecified.
Expand Down Expand Up @@ -201,3 +190,14 @@ enum OperationState {
// google.longrunning.Operations.CancelOperation.
CANCELLED = 7;
}

// Describes the progress of the operation.
// Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1.Progress]
// is used.
message Progress {
// The amount of work estimated.
int64 estimated_work = 1;

// The amount of work completed.
int64 completed_work = 2;
}
6 changes: 6 additions & 0 deletions google/cloud/firestore_v1/gapic/enums.py
Expand Up @@ -91,6 +91,10 @@ class Operator(enum.IntEnum):
``order_by``.
EQUAL (int): Equal.
ARRAY_CONTAINS (int): Contains. Requires that the field is an array.
IN (int): In. Requires that ``value`` is a non-empty ArrayValue with at most 10
values.
ARRAY_CONTAINS_ANY (int): Contains any. Requires that the field is an array and ``value`` is a
non-empty ArrayValue with at most 10 values.
"""

OPERATOR_UNSPECIFIED = 0
Expand All @@ -100,6 +104,8 @@ class Operator(enum.IntEnum):
GREATER_THAN_OR_EQUAL = 4
EQUAL = 5
ARRAY_CONTAINS = 7
IN = 8
ARRAY_CONTAINS_ANY = 9

class UnaryFilter(object):
class Operator(enum.IntEnum):
Expand Down
46 changes: 27 additions & 19 deletions google/cloud/firestore_v1/proto/query.proto
Expand Up @@ -102,6 +102,14 @@ message StructuredQuery {

// Contains. Requires that the field is an array.
ARRAY_CONTAINS = 7;

// In. Requires that `value` is a non-empty ArrayValue with at most 10
// values.
IN = 8;

// Contains any. Requires that the field is an array and
// `value` is a non-empty ArrayValue with at most 10 values.
ARRAY_CONTAINS_ANY = 9;
}

// The field to filter by.
Expand All @@ -114,18 +122,6 @@ message StructuredQuery {
Value value = 3;
}

// A sort direction.
enum Direction {
// Unspecified.
DIRECTION_UNSPECIFIED = 0;

// Ascending.
ASCENDING = 1;

// Descending.
DESCENDING = 2;
}

// A filter with a single operand.
message UnaryFilter {
// A unary operator.
Expand All @@ -150,6 +146,15 @@ message StructuredQuery {
}
}

// The projection of document's fields to return.
message Projection {
// The fields to return.
//
// If empty, all fields are returned. To only return the name
// of the document, use `['__name__']`.
repeated FieldReference fields = 2;
}

// An order on a field.
message Order {
// The field to order by.
Expand All @@ -164,13 +169,16 @@ message StructuredQuery {
string field_path = 2;
}

// The projection of document's fields to return.
message Projection {
// The fields to return.
//
// If empty, all fields are returned. To only return the name
// of the document, use `['__name__']`.
repeated FieldReference fields = 2;
// A sort direction.
enum Direction {
// Unspecified.
DIRECTION_UNSPECIFIED = 0;

// Ascending.
ASCENDING = 1;

// Descending.
DESCENDING = 2;
}

// The projection to return.
Expand Down

0 comments on commit 107e526

Please sign in to comment.