Skip to content

startAt second argument has no effect #284

Closed
@esprehn

Description

@esprehn

[REQUIRED] Describe your environment

  • Operating System version: OS X 10.12.6
  • Firebase SDK version: Firebase admin 4.1.4
  • Firebase Product: database

[REQUIRED] Describe the problem

Using startAt with a query appears to have no effect.

Relevant Code:

  const a: any = await ref.orderByChild('timestamp').startAt(1).limitToFirst(3).once('value');
  const keysA: string[] = [];
  a.forEach((s: any) => { keysA.push(s.key!); return false; });
  console.log(keysA);

  const b: any = await ref.orderByChild('timestamp').startAt(1, keysA[keysA.length - 1]).limitToFirst(3).once('value');
  const keysB: string[] = [];
  b.forEach((s: any) => { keysB.push(s.key!); return false; });
  console.log(keysB);
  console.log(keysA.join() === keysB.join());
[ '-Kstq4UIQPsLL-8EpKTS',
  '-Kstv8g-In43jQOrCpNU',
  '-Kstve77XYA9VlORXm3F' ]
[ '-Kstq4UIQPsLL-8EpKTS',
  '-Kstv8g-In43jQOrCpNU',
  '-Kstve77XYA9VlORXm3F' ]
true

No matter what I pass as the second argument to startAt it doesn't seem to change the values returned.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions