Guest User

Untitled

a guest
Oct 30th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. var marklogic = require('marklogic');
  2. var conn = {
  3. host: '192.168.33.10',
  4. port: 8040,
  5. user: 'admin',
  6. password: 'admin',
  7. authType: 'DIGEST'
  8. }
  9.  
  10. var db = marklogic.createDatabaseClient(conn);
  11.  
  12. db.createCollection(
  13. '/books',
  14. {author: 'Beryl Markham'},
  15. {author: 'WG Sebald'}
  16. )
  17. .result(function(response) {
  18. console.log(JSON.stringify(response, null, 2));
  19. }, function (error) {
  20. console.log(JSON.stringify(error, null, 2));
  21. });
  22.  
  23. D:maroonparallax>node test.js
  24. {
  25. "message": "write document list: cannot process response with 500 status",
  26. "statusCode": 500,
  27. "body": "<error:error xsi:schemaLocation="http://marklogic.com/xdmp/error error.xsd" xmlns:error="http://marklogic.com/xdmp/error" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">n <error:code>XDMP-IMPMODNS</error:code>n <error:name>err:XQST0059</error:name>n <error:xquery-version>1.0-ml</error:xquery-version>n <error:message>Import module namespace mismatch</error:message>n <error:format-string>XDMP-IMPMODNS: (err:XQST0059) Import module namespace http://marklogic.com/rest-api/endpoints/config does not match target namespace http://marklogic.com/rest-api/endpoints/config_DELETE_IF_UNUSED of imported module /MarkLogic/rest-api/endpoints/config.xqy</error:format-string>n <error:retryable>false</error:retryable>n <error:expr/>n <error:data>n <error:datum>http://marklogic.com/rest-api/endpoints/config</error:datum>n <error:datum>http://marklogic.com/rest-api/endpoints/config_DELETE_IF_UNUSED</error:datum>n <error:datum>/MarkLogic/rest-api/endpoints/config.xqy</error:datum>n </error:data>n <error:stack>n <error:frame>n <error:uri>/roxy/lib/rewriter-lib.xqy</error:uri>n <error:line>5</error:line>n <error:column>0</error:column>n <error:xquery-version>1.0-ml</error:xquery-version>n </error:frame>n </error:stack>n</error:error>n"
  28. }
Add Comment
Please, Sign In to add comment