When evaluating a piece of JavaScript on the server using DatabaseClient.eval() seems to always return true when the expression results in a single boolean. Even when the result is false.
To reproduce:
require('marklogic')
.createDatabaseClient({
host: 'localhost',
port: '8000',
database: 'neo-elec-content',
user: 'admin',
password: 'admin',
authType: 'DIGEST'
})
.eval(`false;`)
.result()
.then(res => console.dir(res));
returns the following:
[ { format: 'text', datatype: 'boolean', value: true } ]
We would expect of course value to be false. If you change the expression in the eval() to, say, '42;', then you get the correct result:
[ { format: 'text', datatype: 'integer', value: 42 } ]
I use the marklogic package version 2.9.0 (installed last week with npm i marklogic.)
When evaluating a piece of JavaScript on the server using
DatabaseClient.eval()seems to always returntruewhen the expression results in a single boolean. Even when the result isfalse.To reproduce:
returns the following:
We would expect of course
valueto befalse. If you change the expression in theeval()to, say,'42;', then you get the correct result:I use the
marklogicpackage version 2.9.0 (installed last week withnpm i marklogic.)