Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are in memory elements in marklogic?

Tags:

marklogic

I have couple of documents on which xdmp:node-replace() over certain elements doesnot work. There are some other set of documents which are almost similar to the ones that has problem but xdmp:node-replace works perfectly fine on them. Tried all possibilities that could have gone wrong but in vain. Read some where that xdmp:node-replace function does not work on 'in memory elements'.

So in order to verify whether the issue is with 'in memory elements', I want to know what exactly it is.

Any light on it would be of great help

like image 474
NitZRobotKoder Avatar asked Nov 27 '12 11:11

NitZRobotKoder


People also ask

How is data stored in MarkLogic?

MarkLogic fuses together database internals, search-style indexing, and application server behaviors into a unified system. It uses XML and JSON documents as its data model, and stores the documents within a transactional repository.

What are the indexes in MarkLogic?

The universal index indexes the XML elements and JSON properties in the loaded documents. By default, MarkLogic Server builds a set of indexes that is designed to yield the fast query performance in general usage scenarios. You can configure MarkLogic to index additional data to speed up specific types of searches.

What kind of database is MarkLogic?

MarkLogic is a multi-model NoSQL database that has evolved from its XML database roots to also natively store JSON documents and RDF triples for its semantic data model. It uses a distributed architecture that can handle hundreds of billions of documents and hundreds of terabytes of data.

How many content databases does a typical MarkLogic application need?

Three Databases are created by default, Security Database, Schema Database and Documents Database.


2 Answers

Anything constructed within a query is an in-memory element. For example this XQuery yields an in-memory element:

<test/>

Some function calls also return in-memory elements: xdmp:unquote is an obvious example. Any node that doesn't come from the current database will be treated as an in-memory node.

This query yields a database element (if it exists), which could be modified using xdmp:node-replace:

doc('fubar')/test

This is a typical in-memory update error:

xdmp:node-replace(<x/>, <y/>)

With MarkLogic 6.0-1.1, the error code is XDMP-UPCONSTNODES.

like image 107
mblakele Avatar answered Sep 23 '22 15:09

mblakele


If you want to update in-memory nodes as if they were in the database by using similar function calls, there's a utility library that does that:

https://github.com/marklogic/commons/tree/master/memupdate

The main library also ships with MarkLogic Server under App Services:

appservices/utils/in-mem-update.xqy

like image 34
hunterhacker Avatar answered Sep 25 '22 15:09

hunterhacker