This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // TODO: transform for results | |
| jQuery.ajax({ | |
| url: host + "/search", | |
| username: "foo:bar", | |
| type: "POST", | |
| data: { | |
| length: 10, | |
| structuredQuery: { | |
| and: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var db = new mldb(); // default options | |
| var doc = db.get("/messages/1", function(result) { | |
| logger.debug("Doc content: " + JSON.stringify(result.doc)); | |
| }); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $document = new Document($client); | |
| $document->setContentFile('myfile.xml')->write('/myfile.xml'); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare variable $RESOURCE-URL := "@ml.resource-url"; | |
| (: Becomes... :) | |
| declare variable $RESOURCE-URL := "http://some.resource.com"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xquery version "1.0-ml"; | |
| module namespace addr="http://example.org/address"; | |
| declare namespace rxq="http://exquery.org/ns/restxq"; | |
| declare | |
| %rxq:GET | |
| %rxq:path('/address/id/(.*)') | |
| %rxq:produces('text/html') | |
| function addr:get-address($id){ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xquery version "1.0-ml"; | |
| import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
| ( | |
| let $config := admin:get-configuration() | |
| let $dbid := xdmp:database("barbecue") | |
| let $rangespec := | |
| admin:database-range-element-attribute-index("dateTime", | |
| "http://example.com", "entry", "", "date", | |
| "", fn:false() ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <doc> | |
| <user>spacecadet47</user> | |
| <mobile>(650)701-1212</mobile> | |
| <impact-score>45.21</impact-score> | |
| <dt>2013-11-01T12:00:22</dt> | |
| <location lat="34.156111" long="-118.1319443">Pasadena</location> | |
| <tweet>@NASA thanks for inviting me to the social! I'm learning so much!</tweet> | |
| </doc> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <tweet>@NASA thanks for inviting me to the social! I'm learning so much!</tweet> | |
| <tweet>Rumour has it NASA is announcing MSL finding organic carbon at press conference Tuesday.</tweet> | |
| <tweet>Streambed on Mars! #NASA #MSL</tweet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <options xmlns="http://marklogic.com/appservices/search"> | |
| <search-option>unfiltered</search-option> | |
| <quality-weight>0</quality-weight> | |
| <return-plan>true</return-plan> | |
| <debug>true</debug> | |
| </options> |