Thank you Eric, Regards Shan.
On Wed, Dec 21, 2016 at 3:00 PM, <general-requ...@developer.marklogic.com> wrote: > Send General mailing list submissions to > general@developer.marklogic.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://developer.marklogic.com/mailman/listinfo/general > or, via email, send a message with subject or body 'help' to > general-requ...@developer.marklogic.com > > You can reach the person managing the list at > general-ow...@developer.marklogic.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of General digest..." > > > Today's Topics: > > 1. Re: Search for empty falues (Erik Hennum) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 21 Dec 2016 01:40:59 +0000 > From: Erik Hennum <erik.hen...@marklogic.com> > Subject: Re: [MarkLogic Dev General] Search for empty falues > To: MarkLogic Developer Discussion <general@developer.marklogic.com> > Message-ID: > <DFDF2FD50BF5AA42ADAF93FF2E3CA1850BD62D12@EXCHG10-BE01. > marklogic.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi, Shiv: > > > I need to search for empty values for a given key > > You might need to use a cts.query() constructor instead of QBE for this > kind of query. > > Given this test document: > > xdmp.documentInsert('/test/testdoc.json', {test1:"value", test2:null, > test3:""}); > > If "empty" means null, you can use: > > jsearch.documents().where(cts.jsonPropertyValueQuery('test2', > null)).result(); > > If "empty" means an empty string, you can use: > > jsearch.documents().where(cts.jsonPropertyValueQuery('test3', > "")).result(); > > If "empty" means the absence of a property, you can use: > > jsearch.documents().where(cts.notQuery(cts. > jsonPropertyScopeQuery('test4', cts.trueQuery()))).result(); > > > Hoping that helpsl, > > > Erik Hennum > > > ________________________________ > From: general-boun...@developer.marklogic.com [general-bounces@developer. > marklogic.com] on behalf of Shiv Shankar [shiv.shivshan...@gmail.com] > Sent: Tuesday, December 20, 2016 10:13 AM > To: MarkLogic Developer Discussion > Subject: [MarkLogic Dev General] Search for empty falues > > Hi, > I need to search for empty values for a given key, Tried below, but > resulted nothing. I see values with empty in the collection. Any advice? > > jsearch.documents().where(jsearch.byExample({EMP_ID: ""})).result(); > > Thanks > Shan. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20161221/82a29b80/attachment-0001.html > > ------------------------------ > > _______________________________________________ > General mailing list > General@developer.marklogic.com > Manage your subscription at: > http://developer.marklogic.com/mailman/listinfo/general > > > End of General Digest, Vol 150, Issue 24 > **************************************** >
_______________________________________________ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general