Array Queries with Realm GraphQL

I wish to query properties on an array with Realm Graphql. From the screenshot, you can see that I’m trying to filter out “alias” that equal “metaTitle”. However, the results tab displays objects with “metaTitle”. I feel I’m close but the syntax is incorrect. This page has useful examples, however, these methods did not work for me.

Hi @Anthony_H

Welcome to MongoDB community.

Have you tried: fields_nin : { alias_nin : "metaTitle" } ?

Thanks
Pavel

Thanks, that works!

Hope you don’t mind a followup question. The following query returns results.

contents(query: {fields: {alias_in: "isFeatured"}})

however, when I add additional parameters. No data is returned.

contents(query: {fields: {alias_in: "isFeatured", boolean:true}})

image

@Anthony_H,

Perhaps use an and expression:
{ AND: [{ fields : {alias_in : "isFeatured" }, { fields : { boolean_in : true} }] }

Thanks

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.