Find an Organization with denormChildren


I’m trying to fetch Organizations with denormChildren, and I’ve tried the following:

Organization.fetch({filter: “exists(denormChildren)”}) - returns Orgs with denormChildren fields that have empty arrays

Organization.fetch({filter: “denormChildren.length>0”}) - returns error: Field ‘length’ does not exist in expression: ‘meta.tenantTagId == 5 && ((startsWith(typeIdent, ‘PRT:ORG’)) && (denormChildren.length > 0))’ for type 'Organization

Organization.fetch({filter: “exists(denormChildren[0])”}) - returns error: Query with mapp lookup in expression “meta.tenantTagId == 5 && ((startsWith(typeIdent, ‘PRT:ORG’)) && (exists(denormChildren[0])))” is not yet supported; error at 1: 7

Is there something else I can try? What am I missing?


Have you tried

  filter: "exists(denormChildren)", 
  include: ""

or something like that, so it brings back some of the data that’s on denormChildren? Generally, data stored in another table isn’t returned unless explicitly asked for, I believe.


Ok, if I do that it works! If I don’t specify the include, it will still show the field in the console response, but as empty.

1 Like

@sean.summers FYI that is because in the C3 JavaScript Type System, when calling MyType.make(), all collection fields are automatically instantiated with empty collections if no value is already provided for the field.

I believe this decision was made in order to facilitate writing cleaner code, e.g. I can blindly do:

MyType.fetch().objs.each(obj => console.log(;

since I know objs will always be defined.

(instead of having to always explicitly check if it is defined):

var fetchResult = MyType.fetch();
if (fetchResult.objs) {
  objs.each(obj => console.log(;

Should this “exists” filter work on any non-cassandra type? After the full query didn’t work (translated for my specific type) I tried
filter: “exists(fieldName)”
And it told me:
"Filtering on fields with an included reference type not supported: "
TypeName is not cassandra


The error message means that the value type of TypeName.fieldName is not a persistable (entity) type