Title: Querying content with `null` field · Issue #23 · contentstack/contentstack-java · GitHub
Open Graph Title: Querying content with `null` field · Issue #23 · contentstack/contentstack-java
X Title: Querying content with `null` field · Issue #23 · contentstack/contentstack-java
Description: Hello there, We have a use case where we need to query the content by specifying one of the fields as null. So the use case would be that you have a content with optional field and distinguish between having it filled in with certain val...
Open Graph Description: Hello there, We have a use case where we need to query the content by specifying one of the fields as null. So the use case would be that you have a content with optional field and distinguish betw...
X Description: Hello there, We have a use case where we need to query the content by specifying one of the fields as null. So the use case would be that you have a content with optional field and distinguish betw...
Opengraph URL: https://github.com/contentstack/contentstack-java/issues/23
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Querying content with `null` field","articleBody":"Hello there,\r\n\r\nWe have a use case where we need to query the content by specifying one of the fields as `null`. So the use case would be that you have a content with optional field and distinguish between having it filled in with certain value or not filled at all.\r\n\r\nExample: \r\n\r\nID | field1 | field2\r\n---|------|------\r\n1 | value1 | |\r\n2 | value1 | value2 |\r\n\r\nQ1: `?query={\"field1\": \"value1\", \"field2\": null}` will return id `1`\r\nQ2: `?query={\"field1\": \"value1\", \"field2\":\"value2\"}` will return id `2`\r\n\r\nI noticed that in the implementation you're currently using a `JSONObject.put` which in case I call `query.put(\"field1\", null)` actually removed the key `field1` from the object instead of adding it as a value.\r\n\r\nIs there currently a workaround how to query values like that (except querying all models that fit it and check for the field manually)? ","author":{"url":"https://github.com/ondrejfuhrer","@type":"Person","name":"ondrejfuhrer"},"datePublished":"2020-11-23T16:13:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/23/contentstack-java/issues/23"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e2d5ae9f-611d-9585-de63-8af8ec68e3b9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9528:2F4DA9:2F13A3:3D8B30:6981364A |
| html-safe-nonce | 0227ffdca6b0289e09e5a0bfb11892defd206a4c966022ad6f729bac24046fbd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTI4OjJGNERBOToyRjEzQTM6M0Q4QjMwOjY5ODEzNjRBIiwidmlzaXRvcl9pZCI6IjQwNjM2MjQ5NzQ2MzQ2NjE0NTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fc43c766bd9b1b387566e72b874f9a127a9d0e22f6f918d45ca4e8794fa10e4d |
| hovercard-subject-tag | issue:748934665 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/contentstack/contentstack-java/23/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0012100649bff080c71f26e9aa9b55da14aeb0baa92200e46861c0d34f8f4962/contentstack/contentstack-java/issues/23 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0012100649bff080c71f26e9aa9b55da14aeb0baa92200e46861c0d34f8f4962/contentstack/contentstack-java/issues/23 |
| og:image:alt | Hello there, We have a use case where we need to query the content by specifying one of the fields as null. So the use case would be that you have a content with optional field and distinguish betw... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ondrejfuhrer |
| hostname | github.com |
| expected-hostname | github.com |
| None | 39fe8101494cbb823c09b619b68c80cd4d05ab7279997038dbe06bb91608abe1 |
| turbo-cache-control | no-preview |
| go-import | github.com/contentstack/contentstack-java git https://github.com/contentstack/contentstack-java.git |
| octolytics-dimension-user_id | 24450751 |
| octolytics-dimension-user_login | contentstack |
| octolytics-dimension-repository_id | 106927781 |
| octolytics-dimension-repository_nwo | contentstack/contentstack-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 106927781 |
| octolytics-dimension-repository_network_root_nwo | contentstack/contentstack-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d5b34a4e4898b066c629879feb4b184bc471d6a7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width