Node js i About the Tutorial Node js is a very powerful JavaScript-based framework/platform built on Google Chrome's JavaScript V8 Engine It is used to
Corporation All rights reserved MarkLogic Server Node js Application Developer's Guide 1 MarkLogic 9 June, 2019 Last Revised: 9 0-4, May 2019
With the basics out of the way, it's time to serve up HTML and JSON with Express That'll let you serve up a static website or create an HTTP REST API designed to
Debugging Your Node js Programs 18 Staying Up-to-Date and Finding Help 21 Summary 22 2 A Closer Look at JavaScript 23 Types 23 Type Basics 24
Debugging Your Node js Programs 19 Staying Up-to-Date and Finding Help 22 Summary 23 2 A Closer Look at JavaScript 25 Types 25 Type Basics 26
Node js is an event-based, non-blocking, asynchronous I/O framework that uses Google's V8 JavaScript engine It is used for developing applications that make
Profiter des clusters 117 Chapitre 29: Déploiement de l'application Node js sans temps d'arrêt Chapitre 51: Guide du débutant NodeJS 181 Examples 181
I'm reading Express js Guide — the most popular Node js framework's manual by Appendix B: Express js 4, Node js and MongoDB REST API Tutorial
Node JS est basé sur V8 le moteur Javascript de chrome et la librairie libuv (E/S asynchrones) de données http://mongoosejs com/docs/3 6 x/docs/guide html
js with suitable examples Prerequisites Before proceeding with this tutorial, you should have a basic understanding of JavaScript As we are going
[PDF] node.js notes for professionals pdf
[PDF] node.js quick reference pdf
[PDF] nodejs in action pdf
[PDF] nombre cas coronavirus france 11 mai
[PDF] nombre complexe cours bac informatique
[PDF] nombre complexe cours bac technique
[PDF] nombre de cas covid france 11 mai
[PDF] nombre dérivé
[PDF] nombre rationnel math facile
[PDF] nombre rationnel non décimal
[PDF] nombres premiers exercices corrigés
[PDF] nombres premiers exercices corrigés 3eme
[PDF] nombres premiers exercices corrigés 4ème
[PDF] nombres premiers exercices corrigés pdf
[PDF] nombres premiers exercices corrigés seconde
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
quotesdbs_dbs4.pdfusesText_7