Query for 2 fields

I am querying a LEAF data service for a list of “names | noradId” for a drop down using this query:

const rsoQuery = useMemo(
() =>
Q.dataObjectQuery({
name: ‘SDATasking’,
systemProps: [‘id’],
nonSystemProps: [‘name’, ‘noradCatalogNumber’],
})
.filterTypes(‘SDAViewAlpha’)
.loadSomeSystemProperties(‘id’)
.loadSomeNonSystemProperties([‘name’, ‘noradCatalogNumber’]),
[]
);

For each object returned, I get:

  • dataObjectAuthorizationToken
  • edition
  • id
  • leafVersion
  • name
  • noradCatalogNumber
  • serviceName
  • superTypes (array of 8)
  • type
  • version.

I don’t need all that data. It is very useful to get DataObjects back for most things but sometimes you don’t need that.

Is there anyway to query a LEAF data service and just get JSON back with only the fields requested?

Hey there!

In LEAF versions before 3.11, that is pretty much the bare minimum unfortunately. This quarter, we’re actually working on a minor improvement to let someSystemProperties/noSystemProperties allow you to exclude superTypes, serviceName, and dataObjectAuthorizationToken. So when 3.11.0 comes out around June or July, that will be available! Also 3.11 is a Long Term Support release, so that’s a good one to upgrade to.

I’ll try to remember to post here when that’s available in a release!

The other system fields: id, version, type, edition are required to identify and validate a DataObjects, so LEAF’s preference for now is to maintain them, but feel free to put in a feature request to allow them to be excluded as well and we can discuss or at least track that there’s a need for that!