Skip to content
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

Feature Request: get partial doc data like GraphQL #3235

Closed
cbazza opened this issue Jun 18, 2020 · 2 comments
Closed

Feature Request: get partial doc data like GraphQL #3235

cbazza opened this issue Jun 18, 2020 · 2 comments

Comments

@cbazza
Copy link

cbazza commented Jun 18, 2020

It would be really nice if we could specify a filter when getting doc data so that only certain fields of the document are returned. It could be something very similar to GraphQL and it would work for real time updates as well.

var docRef = db.collection("cities").doc("SF");

var getOptions = {
    filter: '{
      name
      stats {
        area
        population
      }
    }',
};

docRef.get(getOptions).then(function(doc) {
    // city would only contain '{name, stats:{area, population}}'
    var city = doc.data();
}).catch(function(error) {
    console.log("Error getting cached document:", error);
});
@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@wilhuff
Copy link
Contributor

wilhuff commented Jun 19, 2020

Hi! Thanks for writing in. This has been requested before in #212. See discussion there for why we haven't attempted this yet.

@wilhuff wilhuff closed this as completed Jun 19, 2020
@firebase firebase locked and limited conversation to collaborators Jul 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants