googleapis / googleapis/google-cloud-node

`distanceResultField`: Doesn't handle field name with `$` sign correctly

Open
#7,424 3 comments 0 reactions 2 assignees Claimed by @MarkDuckworth View on GitHub
api: firestore library: nodejs-firestore priority: p2
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

I'm using Firebase Admin Node.js SDK, but it seems it just re-exports `findNearest()` from the library, so I'm creating the issue here.

#### Environment details

- OS: macOS 15.3.1
- Node.js version: 22.12.0
- npm version: 10.9.0
- `@google-cloud/firestore` version: 7.11.0
- `firebase-admin` version: 13.2.0

#### Steps to reproduce

1. Pass `distanceResultField: '$distance'` (with the dollar sign) to `findNearest()`.
2. When you run the query, you'll see the key comes like ``{ '`$distance`': 0.123 }`` instead of `{ $distance: 0.123 }`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.