System parameter common to all googleapis for filtering fields
query parameter | header |
---|---|
fields |
X-Goog-FieldMask |
FieldMask contains a list of paths
Basics
- Specify multiple field paths by seperating with a comma
- A field path can be indexed with a
.
or/
- Sub-paths can be specified within
()
- Can specify all fields with
*
Example
- e.g.
{a:[a,b,c]}
- to only get
{a:[c]}
you would usea/c
ora.c
ora(c)
- To include both b and c to get
{a:[b,c]}
you can usea(b,c)
Example 2
- e.g.
{a:[a,b,c],d:[e,f]}
a(b,c),d.f
will return{a:[b,c],d:[f]}
a(*)
ora
will return{a:[a,b,c]}
Remarks
- Default is
*
(i.e.X-Goog-FieldMask: *
) (return all). This may be configured differently across APIs. - Specifying a field that does not exist or no longer exists will return an error
- I don't think there is a way to exclude a field and get all others
Further information
credit to @Prototaxis for helping consolidate