Skip to content

Commit eb0dee4

Browse files
committed
Merge branch 'firestore-pipelines-dart-api-v2' into firestore-pipelines-android
2 parents 91d0191 + f92b930 commit eb0dee4

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

packages/cloud_firestore/cloud_firestore/lib/src/pipeline.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ class Pipeline {
211211
///
212212
/// Example:
213213
/// ```dart
214-
/// pipeline.aggregateStage(
215-
/// AggregateStage(
214+
/// pipeline.aggregateWithOptions(
215+
/// AggregateStageOptions(
216216
/// accumulators: [
217217
/// Expression.field('likes').sum().as('total_likes'),
218218
/// Expression.field('likes').average().as('avg_likes'),
@@ -224,8 +224,8 @@ class Pipeline {
224224
///
225225
/// With options:
226226
/// ```dart
227-
/// pipeline.aggregateStage(
228-
/// AggregateStage(
227+
/// pipeline.aggregateWithOptions(
228+
/// AggregateStageOptions(
229229
/// accumulators: [
230230
/// Expression.field('likes').sum().as('total_likes'),
231231
/// ],

packages/cloud_firestore/cloud_firestore/lib/src/pipeline_expression.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,10 @@ abstract class Expression implements PipelineSerializable {
379379
/// Replaces all occurrences of a string literal
380380
Expression stringReplaceAllLiteral(String find, String replacement) {
381381
return _StringReplaceAllExpression(
382-
this, Constant(find), Constant(replacement));
382+
this,
383+
Constant(find),
384+
Constant(replacement),
385+
);
383386
}
384387

385388
/// Splits this string expression by a delimiter

packages/cloud_firestore/cloud_firestore/test/pipeline_expression_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,24 +750,24 @@ void main() {
750750

751751
test('timestampAddLiteral serializes correctly', () {
752752
final ts = Field('created');
753-
final expr = Expression.timestampAddLiteral(ts, 'days', 1);
753+
final expr = Expression.timestampAddLiteral(ts, 'day', 1);
754754
expect(expr.toMap(), {
755755
'name': 'timestamp_add',
756756
'args': {
757757
'timestamp': ts.toMap(),
758-
'unit': 'days',
758+
'unit': 'day',
759759
'amount': Constant(1).toMap(),
760760
},
761761
});
762762
});
763763

764764
test('timestampTruncate serializes correctly', () {
765-
final expr = Expression.timestampTruncate(Field('ts'), 'days');
765+
final expr = Expression.timestampTruncate(Field('ts'), 'day');
766766
expect(expr.toMap(), {
767767
'name': 'timestamp_truncate',
768768
'args': {
769769
'timestamp': Field('ts').toMap(),
770-
'unit': 'days',
770+
'unit': 'day',
771771
},
772772
});
773773
});

0 commit comments

Comments
 (0)