Hi Dave I have already started exploring JSON XQuery library which is not exposed in REST calls as you mentioned :)
Meanwhile, I tried using schema for handling data types and it's working perfectly. Thanks for your suggestion :) Thanks and Regards, Gnanaprakash Bodireddy Message: 3 Date: Wed, 19 Dec 2012 14:08:27 +0000 From: David Lee <david....@marklogic.com> Subject: Re: [MarkLogic Dev General] MarkLogic 6 XML to JSON DataTypes To: MarkLogic Developer Discussion <general@developer.marklogic.com> Message-ID: <6ad72d76c2d6f04d8be471b70d4b991e018...@exchg10-be02.marklogic.com> Content-Type: text/plain; charset="us-ascii" To get to the level of granularity you want you will need to use the JSON XQuery library (new in 6.0) I dont belive it is exposed in REST calls. (would love to be wrong !) http://docs.marklogic.com/json-lib If you use the "custom" strategy you can fine tune quite a lot using configuration options http://docs.marklogic.com/json:config Including what elements become arrays. To actually override the atomic types of things you need some "undocumented features" which I could share offline but are not officially supported. To *JUST* handle atomic type issues, you could consider a very basic schema that only specifies the elements you are concerned about and wildcards the rest. ----------------------------------------------------------------------------- David Lee Lead Engineer MarkLogic Corporation d...@marklogic.com Phone: +1 812-482-5224 Cell: +1 812-630-7622 www.marklogic.com -----Original Message----- From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of gnanaprakash.bodire...@cognizant.com Sent: Wednesday, December 19, 2012 9:00 AM To: general@developer.marklogic.com Subject: Re: [MarkLogic Dev General] MarkLogic 6 XML to JSON DataTypes Hi David Currently I am not using Schema as there are few limitation to it while validations. Currently I am using Schematron for validation of content. Is there any where we I can specify list of elements which should be treated as numbers/Boolean/string similar to enforcing elements as arrays we have? Thanks and Regards, Gnanaprakash Bodireddy Date: Wed, 19 Dec 2012 12:50:44 +0000 From: David Lee <david....@marklogic.com> Subject: Re: [MarkLogic Dev General] MarkLogic 6 XML to JSON DataTypes To: MarkLogic Developer Discussion <general@developer.marklogic.com> Message-ID: <6ad72d76c2d6f04d8be471b70d4b991e018...@exchg10-be02.marklogic.com> Content-Type: text/plain; charset="iso-8859-1" If there is a schema present which identifies <id> as a numeric type then it come out as unquoted. Similar for booleans. Otherwise the code has no idea that id is not a string ... and for consistancy it treats all untyped atomic valus as strings so you dont get Mis matched data like <user> <id>1</id> <name>Gnana</name> </user> <user> <id>a1</id> <name>Gnana</name> </user> ? What type to assign "id" elements in JSON From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of gnanaprakash.bodire...@cognizant.com Sent: Wednesday, December 19, 2012 6:41 AM To: general@developer.marklogic.com Subject: [MarkLogic Dev General] MarkLogic 6 XML to JSON DataTypes Hi I am exploring MarkLogic "XML to JSON" Rest API and am stuck with how to handle data types. For example: <user> <id>1</id> <name>Gnana</name> </user> Actual JSON Response: {"user":{"id":"1", "name":"Gnana"}} Expected JSON Response: {"user": {"id":1, "name":"Gnana"}} How can I make sure integer/float/decimal/Boolean data types are not inside quotes. Is there any specific config options I could use? Thanks and Regards, Gnanaprakash Bodireddy This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. _______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general ------------------------------ Message: 4 Date: Wed, 19 Dec 2012 10:36:37 -0500 From: Steve Carton <st...@chesbay.net> Subject: [MarkLogic Dev General] Fwd: Re: running two queries at the same time To: MarkLogic Developer Discussion <general@developer.marklogic.com> Message-ID: <50d1df05.6040...@chesbay.net> Content-Type: text/plain; charset="iso-8859-1" Geert - They are two separate .xqy files. The big one does update the log document. The small one has an option to return log information or to return just progress. So I removed the option to return the log data. Now it simply returns the contents of the server fields. But it still waits. -- /Steve / Hi Steve, My guess would be that you are reading the log file in the status query, while it is locked for update in the update query. Could your status query be running in update mode? If you have everything in one xqy, you might want to put it in a separate xqy.. Instead of manipulating a log file at each change, you could write separate log records in some collection as well. Do an xdmp:estimate on the collection and you have your count.. Cheers, Geert *Van:* gene...@developer.marklogic.com [mailto: gene...@developer.marklogic.com] *Namens *Steve Carton *Verzonden:* woensdag 19 december 2012 0:37 *Aan:* gene...@developer.marklogic.com *Onderwerp:* Re: [MarkLogic Dev General] running two queries at the same time -------------- next part -------------- An HTML attachment was scrubbed... URL: http://developer.marklogic.com/pipermail/general/attachments/20121219/68318d1d/attachment-0001.html ------------------------------ _______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general End of General Digest, Vol 102, Issue 40 **************************************** This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. _______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general