Skip to content

Add NOT_EQUAL and NOT_IN protos #3528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/firestore/src/protos/firestore_proto_api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
*/

// Rather than pull these in from other protos, we just alias them to any.
/*
/*
eslint-disable
camelcase, @typescript-eslint/no-explicit-any,
@typescript-eslint/interface-name-prefix, @typescript-eslint/class-name-casing
camelcase, @typescript-eslint/no-explicit-any,
@typescript-eslint/interface-name-prefix, @typescript-eslint/class-name-casing
*/
export declare type ApiClientHookFactory = any;
export declare type PromiseRequestService = any;
Expand All @@ -44,19 +44,23 @@ export declare type FieldFilterOp =
| 'GREATER_THAN'
| 'GREATER_THAN_OR_EQUAL'
| 'EQUAL'
| 'NOT_EQUAL'
| 'ARRAY_CONTAINS'
| 'IN'
| 'ARRAY_CONTAINS_ANY';
| 'ARRAY_CONTAINS_ANY'
| 'NOT_IN';
export interface IFieldFilterOpEnum {
OPERATOR_UNSPECIFIED: FieldFilterOp;
LESS_THAN: FieldFilterOp;
LESS_THAN_OR_EQUAL: FieldFilterOp;
GREATER_THAN: FieldFilterOp;
GREATER_THAN_OR_EQUAL: FieldFilterOp;
EQUAL: FieldFilterOp;
NOT_EQUAL: FieldFilterOp;
ARRAY_CONTAINS: FieldFilterOp;
IN: FieldFilterOp;
ARRAY_CONTAINS_ANY: FieldFilterOp;
NOT_IN: FieldFilterOp;
values(): FieldFilterOp[];
}
export declare const FieldFilterOpEnum: IFieldFilterOpEnum;
Expand Down
64 changes: 53 additions & 11 deletions packages/firestore/src/protos/google/firestore/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -85,32 +85,74 @@ message StructuredQuery {
// Unspecified. This value must not be used.
OPERATOR_UNSPECIFIED = 0;

// Less than. Requires that the field come first in `order_by`.
// The given `field` is less than the given `value`.
//
// Requires:
//
// * That `field` come first in `order_by`.
LESS_THAN = 1;

// Less than or equal. Requires that the field come first in `order_by`.
// The given `field` is less than or equal to the given `value`.
//
// Requires:
//
// * That `field` come first in `order_by`.
LESS_THAN_OR_EQUAL = 2;

// Greater than. Requires that the field come first in `order_by`.
// The given `field` is greater than the given `value`.
//
// Requires:
//
// * That `field` come first in `order_by`.
GREATER_THAN = 3;

// Greater than or equal. Requires that the field come first in
// `order_by`.
// The given `field` is greater than or equal to the given `value`.
//
// Requires:
//
// * That `field` come first in `order_by`.
GREATER_THAN_OR_EQUAL = 4;

// Equal.
// The given `field` is equal to the given `value`..
EQUAL = 5;

// Contains. Requires that the field is an array.
// The given `field` is not equal to the given `value`.
//
// Requires:
//
// * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
// * That `field` comes first in the `order_by`.
NOT_EQUAL = 6;

// The given `field` is an array that contains the given `value`.
ARRAY_CONTAINS = 7;

// In. Requires that `value` is a non-empty ArrayValue with at most 10
// values.
// The given `field` is equal to at least one value in the given array.
//
// Requires:
//
// * That `value` is a non-empty `ArrayValue` with at most 10 values.
// * No other `IN` or `ARRAY_CONTAINS_ANY`. (-- or `NOT_IN` --)
IN = 8;

// Contains any. Requires that the field is an array and
// `value` is a non-empty ArrayValue with at most 10 values.
// The given `field` is an array that contains any of the values in the
// given array.
//
// Requires:
//
// * That `value` is a non-empty `ArrayValue` with at most 10 values.
// * No other `IN` or `ARRAY_CONTAINS_ANY`. (-- or `NOT_IN` --)
ARRAY_CONTAINS_ANY = 9;

// The value of the `field` is not in the given array.
//
// Requires:
//
// * That `value` is a non-empty `ArrayValue` with at most 10 values.
// * No other `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`,
// `IS_NOT_NULL`, or `IS_NOT_NAN`.
// * That `field` comes first in the `order_by`.
NOT_IN = 10;
}

// The field to filter by.
Expand Down