[PDF] Nodejs Application Developer’s Guide - MarkLogic





Previous PDF Next PDF



VisionFive Node.js Application Note

Jan 27 2022 install Node.js in the VisionFive Fedora system. • play the BrowserQuest



Node.js Foundation Trademark Guidelines for the Node.js Marks

js trademarks including “Node.js” (the word mark in plain text or in logo form)



Track Overview

All University Graduates with prerequisites of basic programming skills HTML and CSS. 450. Hours around 3 months (learning and Node.js Developer.



Typeface Use

This report presents selected findings from the 2018 Node.js User Survey. • The primary objective of the research was to profile Node.js users and identify 



2016 User Survey Report

By many measures Node.js is the fastest growing and most significant development language right now. With 3.5 million users and an annual growth rate of 100%



Track Overview

All University Graduates with prerequisites of basic programming Nodejs. • Postman. Candidates are working together in one of the following Suggested.



Red Hat build of Node.js 16 Node.js Runtime Guide

Mar 15 2022 Prerequisites. FIPS is enabled on the RHEL host. Procedure. 1. In your Node.js project



Brand Guide

Use the colour and white logo if possible otherwise on all dark backgrounds use the solid white logo. 1.03. Logo Variations. Node.JS. Brand Guide. Page 



Running Node.js with IBM HTTP Server for i

Sep 14 2015 Node.js FastCGI application flow. Software prerequisites. Node.js for IBM i is packaged as part of 5733OPS



Node.js Everywhere

Node.js Everywhere



A PDF Reference for The Complete Nodejs Dev Course

Section 3: Node js Module System Lesson 1: Section Intro The best way to get started with Node js is to explore its module system The module system lets you load external libraries into your application That’ll enable you to take advantage of built-in Node js modules as well as third-party npm modules This includes



What prerequisites are needed to fully understand Nodejs?

Node js has an amazing standard library including a first-class support for networking The createServer() method of http creates a new HTTP server and returns it The server is set to listen on the specified port and hostname



CS193C: Client-Side Internet Technology

The prerequisite for this class is either Stanford CS106A a quarter of college-level programming from another university or a year of high-school-level programming If you’ve only had the minimum prereq and you did well in that class you’ll probably be fine





Nodejs Helps NASA Keep Astronauts Safe and Data Accessible

“We have several Node js services running on a single host and some of our dependencies to connect to Oracle require older versions of Node js than our other services would” Estes said “Docker lets us do that without having to code to the least common denominator



Searches related to prerequisite for node js filetype:pdf

Node JS Brand Guide 1 01 Logo overview This refresh of the original logo modernizes the hexagon for a more sophistiated look The overlapping bands within the shape represent the cross-platform environment of node js PRIMARY LOGO PRIMARY ICON + PATTERN

What are the prerequisites for learning NodeJS?

    In this article, we'll discuss what these prerequisites are and how you can acquire them. The first prerequisite for understanding Node.js is having a strong foundation in JavaScript. Since Node.js is

What do you need to know about NodeJS?

    To fully understand Node.js, it's recommended to have a solid understanding of the following concepts and technologies: JavaScript: Node.js is built on top of JavaScript, so understanding the basics of the language is essential. Understanding concepts such as variables, functions, and object-oriented programming is crucial.

How do I create a nodeJS Web application?

    Press Esc to close the start window. Press Ctrl + Q to open the search box, then type Node.js. Choose Blank Node.js Web Application (JavaScript). In the dialog, select Create.

Can I install multiple versions of NodeJS?

    Although Node.js is built for 32-bit and 64-bit architectures, the Node.js installer only supports one version installed at a time. If Visual Studio doesn't detect your installed runtime (it generally does), configure your project to reference the installed runtime:
Copyright © 2022 MarkLogic Corporation. All rights reserved.

MarkLogic Server

Node.js Application Developer's

Guide 1

MarkLogic 10

June, 2019

Last Revised: 10.0-9, February, 2022

MarkLogic Server Table of Contents

MarkLogic 10 - June, 2019Node.js Application Developer's Guide - Page 2

Table of Contents

Node.js Application Developer's Guide

1.0 Introduction to the Node.js Client API ..........................................................9

1.1 Getting Started ........................................................................................................9

1.2 Required Software ................................................................................................14

1.3 Security Requirements ..........................................................................................15

1.3.1 Basic Security Requirements ....................................................................15

1.3.2 Controlling Document Access ..................................................................16

1.3.3 Evaluating Requests Against a Different Database ..................................16

1.3.4 Evaluating or Invoking Server-Side Code ................................................16

1.4 Terms and Definitions ..........................................................................................17

1.5 Key Concepts and Conventions ............................................................................18

1.5.1 MarkLogic Namespace .............................................................................18

1.5.2 Parameter Passing Conventions ................................................................18

1.5.3 Document Descriptor ................................................................................19

1.5.4 Supported Result Handling Techniques ...................................................19

1.5.5 Promise Result Handling Pattern ..............................................................20

1.5.6 Stream Result Handling Pattern ................................................................21

1.5.7 Streaming Into the Database .....................................................................22

1.5.8 Performing Point-in-Time Operations ......................................................23

1.5.9 Error Handling ..........................................................................................24

1.6 Creating a Database Client ...................................................................................25

1.7 Authentication and Connection Security ..............................................................26

1.7.1 Connecting to MarkLogic with SSL .........................................................27

1.7.2 Using SAML Authentication ....................................................................27

1.7.3 Using Certificate-Based Authentication ...................................................28

1.7.3.1 Obtaining a Client Certificate ...................................................28

1.7.3.2 Configuring Your App Server ...................................................29

1.7.3.3 Examples: Database Client Configuration ................................29

1.7.4 Using Kerberos Authentication ................................................................30

1.7.4.1 Configuring MarkLogic to Use Kerberos .................................30

1.7.4.2 Configuring Your Client Host for Kerberos .............................31

1.7.4.3 Creating a Database Client That Uses Kerberos .......................31

1.8 Using the Examples in This Guide .......................................................................31

2.0 Manipulating Documents .............................................................................33

2.1 Introduction to Document Operations ..................................................................33

2.2 Loading Documents into the Database .................................................................36

2.2.1 Overview ...................................................................................................36

2.2.2 Input Document Descriptors .....................................................................37

MarkLogic Server Table of Contents

MarkLogic 10 - June, 2019Node.js Application Developer's Guide - Page 3

2.2.3 Calling Convention ...................................................................................38

2.2.4 Example: Loading A Single Document ....................................................39

2.2.5 Example: Loading Multiple Documents ...................................................40

2.2.6 Inserting or Updating Metadata for One Document .................................42

2.2.7 Automatically Generating Document URIs ..............................................43

2.2.8 Transforming Content During Ingestion ...................................................43

2.3 Reading Documents from the Database ................................................................44

2.3.1 Retrieving the Contents of a Document By URI ......................................45

2.3.2 Retrieving Metadata About a Document ..................................................46

2.3.3 Example: Retrieving Content and Metadata .............................................48

2.3.4 Transforming Content During Retrieval ...................................................50

2.4 Removing Content from the Database ..................................................................51

2.4.1 Removing Documents By URI .................................................................51

2.4.2 Removing Sets of Documents ...................................................................52

2.4.3 Removing All Documents ........................................................................53

2.5 Managing Collections of Objects and Documents ...............................................54

2.6 Performing a Lightweight Document Check ........................................................56

2.7 Conditional Updates Using Optimistic Locking ...................................................57

2.7.1 Understanding Optimistic Locking ...........................................................57

2.7.2 Enable Optimistic Locking .......................................................................58

2.7.3 Obtain a Version Id ...................................................................................59

2.7.4 Apply a Conditional Update .....................................................................60

2.8 Working with Binary Documents .........................................................................61

2.8.1 Type of Binary Documents .......................................................................61

2.8.2 Streaming Binary Content ........................................................................62

2.8.3 Retrieving Binary Content with Range Requests .....................................62

2.9 Working with Temporal Documents ....................................................................63

2.10 Working with Metadata ........................................................................................64

2.10.1 Metadata Categories .................................................................................64

2.10.2 Metadata Format .......................................................................................65

2.10.3 Working with Document Properties .........................................................67

2.10.4 Disabling Metadata Merging ....................................................................68

2.10.4.1 When to Consider Disabling Metadata Merging .......................68

2.10.4.2 How to Disable Metadata Merging ...........................................69

3.0 Patching Document Content or Metadata ....................................................70

3.1 Introduction to Content and Metadata Patching ...................................................70

3.2 Example: Adding a JSON Property ......................................................................72

3.3 Patch Reference ....................................................................................................73

3.3.1 insert ..........................................................................................................75

3.3.2 replace .......................................................................................................76

3.3.3 replaceInsert ..............................................................................................78

3.3.4 remove ......................................................................................................80

3.3.5 apply ..........................................................................................................81

3.3.6 library ........................................................................................................82

3.3.7 pathLanguage ............................................................................................82

MarkLogic Server Table of Contents

MarkLogic 10 - June, 2019Node.js Application Developer's Guide - Page 4

3.3.8 collections .................................................................................................82

3.3.9 permissions ...............................................................................................83

3.3.10 properties ..................................................................................................83

3.3.11 quality .......................................................................................................83

3.3.12 metadataValues .........................................................................................83

3.4 Defining the Context for a Patch Operation .........................................................84

3.5 How Position Affects the Insertion Point .............................................................84

3.6 Patch Examples .....................................................................................................86

3.6.1 Preparing to Run the Examples ................................................................86

3.6.2 Example: Insert .........................................................................................87

3.6.3 Example: Replace .....................................................................................90

3.6.4 Example: ReplaceInsert ............................................................................93

3.6.5 Example: Remove .....................................................................................96

3.6.6 Example: Patching Metadata ....................................................................99

3.7 Creating a Patch Without a Builder ....................................................................102

3.8 Patching XML Documents .................................................................................103

3.9 Constructing Replacement Data on MarkLogic Server ......................................104

3.9.1 Overview of Replacement Constructor Functions ..................................105

3.9.2 Using a Builtin Replacement Constructor ..............................................106

3.9.3 Passing Parameters to a Replacement Constructor .................................107

3.9.4 Using a Custom Replacement Constructor .............................................107

3.9.5 Writing a Custom Replacement Constructor ..........................................108

3.9.6 Installing or Updating a Custom Replace Library ..................................109

3.9.7 Uninstalling a Custom Replace Library ..................................................110

3.9.8 Example: Custom Replacement Constructors ........................................111

3.9.9 Additional Operations .............................................................................116

4.0 Querying Documents and Metadata ...........................................................117

4.1 Query Interface Overview ..................................................................................117

4.2 Introduction to Search Concepts .........................................................................118

4.2.1 Search Overview .....................................................................................118

4.2.2 Query Styles ............................................................................................119

4.2.3 Types of Query .......................................................................................120

4.2.4 Indexing ..................................................................................................122

4.3 Understanding the queryBuilder Interface ..........................................................122

4.4 Searching with String Queries ............................................................................125

4.4.1 Introduction to String Query ...................................................................125

4.4.2 Example: Basic String Query .................................................................126

4.4.3 Using Constraints in a String Query .......................................................128

4.4.4 Example: Using Constraints in a String Query .......................................129

4.4.5 Using a Custom Constraint Parser ..........................................................131

4.4.6 Example: Custom Constraint Parser .......................................................132

4.4.6.1 Implementing the Constraint Parser ........................................132

4.4.6.2 Installing the Constraint Parser ...............................................133

4.4.6.3 Using the Custom Constraint in a String Query ......................133

4.4.7 Additional Information ...........................................................................135

MarkLogic Server Table of Contents

MarkLogic 10 - June, 2019Node.js Application Developer's Guide - Page 5

4.5 Searching with Query By Example ....................................................................135

4.5.1 Introduction to QBE ................................................................................135

4.5.2 Creating a QBE with queryBuilder .........................................................136

4.5.3 Querying XML Content With QBE ........................................................138

4.5.4 Additional Information ...........................................................................139

4.6 Searching with Structured Queries .....................................................................140

4.6.1 Basic Usage .............................................................................................140

4.6.2 Example: Using Structured Query ..........................................................140

4.6.3 Builder Methods Taxonomy Reference ..................................................142

4.6.3.1 Basic Content Queries .............................................................143

4.6.3.2 Logical Composers ..................................................................145

4.6.3.3 Location Qualifiers ..................................................................145

4.6.3.4 Document Selectors .................................................................147

4.6.4 Query Parameter Helper Functions .........................................................147

4.6.5 Search Result Refiners ............................................................................149

4.7 Searching with Combined Query ........................................................................150

4.8 Searching Values Metadata Fields ......................................................................152

4.9 Querying Lexicons and Range Indexes ..............................................................152

4.9.1 Querying Values in a Lexicon or Range Index .......................................153

4.9.2 Finding Value Co-Occurrences in Lexicons ...........................................155

4.9.3 Building an Index Reference ..................................................................157

4.9.4 Refining the Results of a Values or Co-Occurrence Query ....................158

4.9.5 Analyzing Lexicons and Range Indexes with Aggregate Functions ......159

4.9.5.1 Aggregate Function Overview ................................................159

4.9.5.2 Using Builtin Aggregate Functions .........................................159

4.9.5.3 Using User-Defined Aggregate Functions ..............................160

4.10 Generating Search Facets ....................................................................................161

4.10.1 Defining a Simple Facet .........................................................................161

4.10.2 Naming a Facet .......................................................................................163

4.10.3 Including Facet Options ..........................................................................163

4.10.4 Defining Bucket Ranges .........................................................................163

4.10.5 Creating and Using Custom Constraint Facets .......................................164

4.11 Refining Query Results .......................................................................................165

4.11.1 Available Refinements ............................................................................165

4.11.2 Paginating Query Results ........................................................................166

4.11.3 Returning Metadata .................................................................................167

4.11.4 Excluding Document Descriptors or Values From Search Results ........167

4.11.5 Generating Search Snippets ....................................................................168

4.11.6 Transforming the Search Results ............................................................169

4.11.7 Extracting a Portion of Each Matching Document .................................170

4.12 Generating Search Term Completion Suggestions .............................................173

4.12.1 Understanding the Suggestion Interface .................................................173

4.12.2 Example: Generating Search Term Suggestions ....................................176

4.13 Loading the Example Data .................................................................................179

5.0 Using the Optic API for Relational Operations .........................................183

MarkLogic Server Table of Contents

MarkLogic 10 - June, 2019Node.js Application Developer's Guide - Page 6

5.1 Introduction to the Optic Interfaces ....................................................................183

5.2 Interface Summary ..............................................................................................184

5.3 Preparing to Run the Examples ..........................................................................184

5.4 Generating a Plan ................................................................................................185

5.5 Invoking a Plan ...................................................................................................186

5.6 Configuring Row Set Format ..............................................................................189

5.6.1 Configuration Options ............................................................................189

5.6.2 Layout Examples ....................................................................................189

5.7 Streaming Row Data ...........................................................................................193

5.7.1 Object Mode Streaming ..........................................................................193

5.7.2 Chunked Mode Streaming ......................................................................195

5.7.3 Sequence Mode Streaming .....................................................................195

5.8 Passing Parameters into a Plan ...........................................................................197

5.9 Handling Complex Column Values ....................................................................197

5.10 Generating an Execution Plan .............................................................................198

5.11 Serializing a Plan ................................................................................................199

6.0 Working With Semantic Data ....................................................................201

6.1 Overview of Common Semantics Tasks .............................................................201

6.2 Loading Triples ...................................................................................................202

6.3 Querying Semantic Triples With SPARQL ........................................................204

6.4 Example: SPARQL Query ..................................................................................205

6.5 Managing Graphs ................................................................................................206

6.5.1 Creating or Replacing a Graph ...............................................................207

6.5.2 Adding Triples to an Existing Graph ......................................................207

6.5.3 Removing a Graph ..................................................................................208

6.5.4 Retrieving the Contents, Metadata, or Permissions of a Graph ..............209

6.5.5 Testing for Graph Existence ...................................................................210

6.5.6 Retrieving a List of Graphs .....................................................................211

6.6 Using SPARQL Update to Manage Graphs and Graph Data .............................211

6.7 Applying Inferencing Rules to a SPARQL Query or Update .............................213

6.7.1 Basic Inference Ruleset Usage ...............................................................213

6.7.2 Example: SPARQL Query With Inference Ruleset ................................214

6.7.3 Example: SPARQL Update With Inference Rulesets .............................214

6.7.4 Controlling the Default Database Ruleset ..............................................214

7.0 Managing Transactions ..............................................................................216

7.1 Transaction Overview .........................................................................................216

7.2 Creating a Transaction ........................................................................................217

7.3 Associating a Transaction with an Operation .....................................................218

7.4 Committing a Transaction ..................................................................................219

7.5 Rolling Back a Transaction .................................................................................219

7.6 Example: Using Promises With a Multi-Statement Transaction ........................220

7.7 Checking Transaction Status ..............................................................................220

7.8 Managing Transactions When Using a Load Balancer ......................................220

MarkLogic Server Table of Contents

MarkLogic 10 - June, 2019Node.js Application Developer's Guide - Page 7

8.0 Extensions, Transformations, and Server-Side Code Execution ...............223

8.1 Ways to Extend and Customize the API .............................................................223

8.2 Working with Resource Service Extensions .......................................................224

8.2.1 What is a Resource Service Extension? ..................................................224

8.2.2 Creating a Resource Service Extension ..................................................225

8.2.3 Installing a Resource Service Extension .................................................225

8.2.4 Using a Resource Service Extension ......................................................227

8.2.5 Example: Installing and Using a Resource Service Extension ...............228

8.2.6 Retrieving the Implementation of a Resource Service Extension ..........231

8.2.7 Discovering Resource Service Extensions .............................................231

8.2.8 Deleting Resource Service Extensions ...................................................232

8.3 Working with Content Transformations .............................................................233

8.3.1 What is a Content Transformation? ........................................................233

8.3.2 Creating a Transformation ......................................................................234

8.3.3 Installing a Transformation .....................................................................234

8.3.4 Using a Transformation ..........................................................................235

8.3.5 Example: Read, Write, and Query Transforms .......................................237

8.3.5.1 Install the Transforms ..............................................................237

8.3.5.2 Use the Write Transform .........................................................238

8.3.5.3 Use the Read Transform ..........................................................240

8.3.5.4 Use the Query Transform ........................................................241

8.3.5.5 Read Transform Source Code .................................................243

8.3.5.6 Write Transform Source Code ................................................244

8.3.5.7 Query Transform Source Code ...............................................245

8.3.6 Discovering Installed Transforms ...........................................................246

8.3.7 Deleting a Transformation ......................................................................246

8.4 Error Reporting in Extensions and Transformations ..........................................247

8.4.1 Example: Reporting Errors in JavaScript ...............................................247

8.4.2 Example: Reporting Errors in XQuery ...................................................249

8.5 Evaluating Ad-Hoc Code and Server-Side Modules ..........................................250

8.5.1 Required Privileges .................................................................................250

8.5.2 Evaluating a Ad-Hoc Query ...................................................................251

8.5.3 Invoking a Module Installed on MarkLogic Server ................................253

8.5.4 Interpreting the Results of Eval or Invoke ..............................................255

8.5.5 Specifying External Variable Values ......................................................256

8.6 Managing Assets in the Modules Database ........................................................257

8.6.1 Overview of Asset Management .............................................................258

8.6.2 Installing or Updating an Asset ..............................................................260

8.6.3 Referencing an Asset from Server-Side Code ........................................260

8.6.4 Removing an Asset .................................................................................261

8.6.5 Retrieving an Asset List ..........................................................................261

8.6.6 Retrieving an Asset .................................................................................262

9.0 Administering REST API Instances ..........................................................263

9.1 What Is a REST API Instance? ...........................................................................263

MarkLogic Server Table of Contents

MarkLogic 10 - June, 2019Node.js Application Developer's Guide - Page 8

9.2 Creating an Instance ............................................................................................264

9.3 Configuring Instance Properties .........................................................................264

9.4 Retrieving Configuration Information ................................................................266

9.5 Removing an Instance .........................................................................................266

10.0 Creating Data Services and Developer Actions in Node.js .......................267

10.1 Node.js Annotations for Declarations .................................................................268

10.2 Using Gulp to Generate Models .........................................................................269

10.3 Generated Modules .............................................................................................270

10.4 Expected Pattern of Use ......................................................................................270

11.0 Data Movement in the Node.js API ...........................................................272

11.1 Concurrency and Large Data Sets in Node.js .....................................................272

11.1.1 Optimal Concurrency ..............................................................................272

11.1.2 Detection of Server Factors ....................................................................273

11.1.3 IO With Node.js Streams ........................................................................273

11.1.4 Data Movement Functions ......................................................................274

11.2 Node-client-api - 2.8.0 ........................................................................................274

11.2.1 Ingesting Documents using - writeAll API .............................................274

11.2.1.1 writeAll (options) ....................................................................275

11.3 Node-client-api - 2.9.0 ........................................................................................279

11.3.1 Collecting Document uris - queryAll API ..............................................280

11.3.2 Exporting Documents - readAll API ......................................................284

11.3.2.1 queryToReadAll ......................................................................288

11.4 Node-client-api - 3.0.0 ........................................................................................289

11.4.1 Reprocessing Documents - transformAll API ........................................289

11.4.1.1 queryToTransformAll .............................................................293

11.4.2 Deleting Documents - removeAllUris API .............................................294

11.4.2.1 queryToRemoveAll .................................................................298

11.4.3 Exporting Rows - queryAll API .............................................................298

11.4.4 Signature Changes ..................................................................................304

12.0 Technical Support ......................................................................................306

13.0 Copyright ...................................................................................................308

MarkLogic Server Introduction to the Node.js Client API MarkLogic 10 - June, 2019Node.js Application Developer's Guide - Page 9

1.0 Introduction to the Node.js Client API

32
The Node.js Client API enables you to create Node.js applications that can read, write, and query documents and semantic data in a MarkLogic database.

Getting Started

• Required Software • Security Requirements • Terms and Definitions • Key Concepts and Conventions • Creating a Database Client • Authentication and Connection Securityquotesdbs_dbs6.pdfusesText_11
[PDF] prerequisite to learn json

[PDF] preschool alphabet worksheets pdf

[PDF] preschool hand washing curriculum

[PDF] preschool music standards

[PDF] preschool songs with lyrics

[PDF] preschool to kindergarten summer packet pdf

[PDF] prescribing guidelines in psychiatry

[PDF] present past and past participle verbs list pdf

[PDF] present value annuity table

[PDF] present value of annuity ba ii plus

[PDF] present value of annuity due table

[PDF] present value table

[PDF] present value table pdf

[PDF] presentation about yourself ideas

[PDF] presentation assignment sheet