Skip to content

Commit e959d0f

Browse files
Merge pull request #507 from martin-neotech/4.0-docs-update
JSDocs updates and fixes.
2 parents f05d938 + d7eb818 commit e959d0f

File tree

5 files changed

+96
-96
lines changed

5 files changed

+96
-96
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ var writeTxResultPromise = session.writeTransaction(async txc => {
307307
// used transaction will be committed automatically, no need for explicit commit/rollback
308308

309309
var result = await txc.run(
310-
"MERGE (alice:Person {name : 'Alice' }) RETURN alice.name AS name"
310+
"MERGE (alice:Person {name : 'Alice'}) RETURN alice.name AS name"
311311
)
312312
// at this point it is possible to either return the result or process it and return the
313313
// result of processing it is also possible to run more statements in the same transaction
@@ -430,19 +430,19 @@ _**Any javascript number value passed as a parameter will be recognized as `Floa
430430

431431
#### Writing integers
432432

433-
Numbers written directly e.g. `session.run("CREATE (n:Node {age: {age}})", {age: 22})` will be of type `Float` in Neo4j.
433+
Numbers written directly e.g. `session.run("CREATE (n:Node {age: $age})", {age: 22})` will be of type `Float` in Neo4j.
434434
To write the `age` as an integer the `neo4j.int` method should be used:
435435

436436
```javascript
437437
var neo4j = require('neo4j-driver')
438438

439-
session.run('CREATE (n {age: {myIntParam}})', { myIntParam: neo4j.int(22) })
439+
session.run('CREATE (n {age: $myIntParam})', { myIntParam: neo4j.int(22) })
440440
```
441441

442442
To write integers larger than can be represented as JavaScript numbers, use a string argument to `neo4j.int`:
443443

444444
```javascript
445-
session.run('CREATE (n {age: {myIntParam}})', {
445+
session.run('CREATE (n {age: $myIntParam})', {
446446
myIntParam: neo4j.int('9223372036854775807')
447447
})
448448
```
@@ -505,7 +505,7 @@ To run tests against "default" Neo4j version:
505505

506506
To run tests against specified Neo4j version:
507507

508-
./runTests.sh '-e 3.1.3'
508+
./runTests.sh '-e 4.0.0'
509509

510510
Simple `npm test` can also be used if you already have a running version of a compatible Neo4j server.
511511

src/driver.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class Driver {
101101
*
102102
* @public
103103
* @param {Object} param - The object parameter
104-
* @param {string} param.database - the target database to verify connectivity for.
104+
* @param {string} param.database - The target database to verify connectivity for.
105105
* @returns {Promise} promise resolved with server info or rejected with error.
106106
*/
107107
verifyConnectivity ({ database = '' } = {}) {
@@ -111,8 +111,8 @@ class Driver {
111111
}
112112

113113
/**
114-
* Returns whether the server supports multi database capabilities based on the handshaked protocol
115-
* version.
114+
* Returns whether the server supports multi database capabilities based on the protocol
115+
* version negotiated via handshake.
116116
*
117117
* Note that this function call _always_ causes a round-trip to the server.
118118
*
@@ -136,12 +136,12 @@ class Driver {
136136
*
137137
* @public
138138
* @param {Object} param - The object parameter
139-
* @param {string} param.defaultAccessMode=WRITE - the access mode of this session, allowed values are {@link READ} and {@link WRITE}.
140-
* @param {string|string[]} param.bookmarks - the initial reference or references to some previous
139+
* @param {string} param.defaultAccessMode=WRITE - The access mode of this session, allowed values are {@link READ} and {@link WRITE}.
140+
* @param {string|string[]} param.bookmarks - The initial reference or references to some previous
141141
* transactions. Value is optional and absence indicates that that the bookmarks do not exist or are unknown.
142-
* @param {number} param.fetchSize - the record fetch size of each batch of this session.
142+
* @param {number} param.fetchSize - The record fetch size of each batch of this session.
143143
* Use {@link ALL} to always pull all records in one batch. This will override the config value set on driver config.
144-
* @param {string} param.database - the database this session will operate on.
144+
* @param {string} param.database - The database this session will operate on.
145145
* @return {Session} new session.
146146
*/
147147
session ({
@@ -172,10 +172,10 @@ class Driver {
172172
*
173173
* @public
174174
* @param {Object} param
175-
* @param {string} param.defaultAccessMode=WRITE - the access mode of this session, allowed values are {@link READ} and {@link WRITE}
176-
* @param {string|string[]} param.bookmarks - the initial reference or references to some previous transactions. Value is optional and
175+
* @param {string} param.defaultAccessMode=WRITE - The access mode of this session, allowed values are {@link READ} and {@link WRITE}.
176+
* @param {string|string[]} param.bookmarks - The initial reference or references to some previous transactions. Value is optional and
177177
* absence indicates that the bookmarks do not exist or are unknown.
178-
* @param {string} param.database - the database this session will operate on.
178+
* @param {string} param.database - The database this session will operate on.
179179
* @returns {RxSession} new reactive session.
180180
*/
181181
rxSession ({

src/session.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ class Session {
4444
* @protected
4545
* @param {Object} args
4646
* @param {string} args.mode the default access mode for this session.
47-
* @param {ConnectionProvider} args.connectionProvider - the connection provider to acquire connections from.
48-
* @param {Bookmark} args.bookmark - the initial bookmark for this session.
47+
* @param {ConnectionProvider} args.connectionProvider - The connection provider to acquire connections from.
48+
* @param {Bookmark} args.bookmark - The initial bookmark for this session.
4949
* @param {string} args.database the database name
50-
* @param {Object} args.config={} - this driver configuration.
51-
* @param {boolean} args.reactive - whether this session should create reactive streams
52-
* @param {number} args.fetchSize - defines how many records is pulled in each pulling batch
50+
* @param {Object} args.config={} - This driver configuration.
51+
* @param {boolean} args.reactive - Whether this session should create reactive streams
52+
* @param {number} args.fetchSize - Defines how many records is pulled in each pulling batch
5353
*/
5454
constructor ({
5555
mode,
@@ -91,8 +91,8 @@ class Session {
9191
* @public
9292
* @param {mixed} query - Cypher query to execute
9393
* @param {Object} parameters - Map with parameters to use in query
94-
* @param {TransactionConfig} [transactionConfig] - configuration for the new auto-commit transaction.
95-
* @return {Result} - New Result
94+
* @param {TransactionConfig} [transactionConfig] - Configuration for the new auto-commit transaction.
95+
* @return {Result} New Result.
9696
*/
9797
run (query, parameters, transactionConfig) {
9898
const { validatedQuery, params } = validateQueryAndParameters(
@@ -151,8 +151,8 @@ class Session {
151151
*
152152
* While a transaction is open the session cannot be used to run queries outside the transaction.
153153
*
154-
* @param {TransactionConfig} [transactionConfig] - configuration for the new auto-commit transaction.
155-
* @returns {Transaction} - New Transaction
154+
* @param {TransactionConfig} [transactionConfig] - Configuration for the new auto-commit transaction.
155+
* @returns {Transaction} New Transaction.
156156
*/
157157
beginTransaction (transactionConfig) {
158158
// this function needs to support bookmarks parameter for backwards compatibility
@@ -202,7 +202,7 @@ class Session {
202202
/**
203203
* Return the bookmark received following the last completed {@link Transaction}.
204204
*
205-
* @return {string[]} a reference to a previous transaction
205+
* @return {string[]} A reference to a previous transaction.
206206
*/
207207
lastBookmark () {
208208
return this._lastBookmark.values()
@@ -216,10 +216,10 @@ class Session {
216216
* delay of 1 second and maximum retry time of 30 seconds. Maximum retry time is configurable via driver config's
217217
* `maxTransactionRetryTime` property in milliseconds.
218218
*
219-
* @param {function(tx: Transaction): Promise} transactionWork - callback that executes operations against
219+
* @param {function(tx: Transaction): Promise} transactionWork - Callback that executes operations against
220220
* a given {@link Transaction}.
221-
* @param {TransactionConfig} [transactionConfig] - configuration for all transactions started to execute the unit of work.
222-
* @return {Promise} resolved promise as returned by the given function or rejected promise when given
221+
* @param {TransactionConfig} [transactionConfig] - Configuration for all transactions started to execute the unit of work.
222+
* @return {Promise} Resolved promise as returned by the given function or rejected promise when given
223223
* function or commit fails.
224224
*/
225225
readTransaction (transactionWork, transactionConfig) {
@@ -235,10 +235,10 @@ class Session {
235235
* delay of 1 second and maximum retry time of 30 seconds. Maximum retry time is configurable via driver config's
236236
* `maxTransactionRetryTime` property in milliseconds.
237237
*
238-
* @param {function(tx: Transaction): Promise} transactionWork - callback that executes operations against
238+
* @param {function(tx: Transaction): Promise} transactionWork - Callback that executes operations against
239239
* a given {@link Transaction}.
240-
* @param {TransactionConfig} [transactionConfig] - configuration for all transactions started to execute the unit of work.
241-
* @return {Promise} resolved promise as returned by the given function or rejected promise when given
240+
* @param {TransactionConfig} [transactionConfig] - Configuration for all transactions started to execute the unit of work.
241+
* @return {Promise} Resolved promise as returned by the given function or rejected promise when given
242242
* function or commit fails.
243243
*/
244244
writeTransaction (transactionWork, transactionConfig) {
@@ -255,7 +255,7 @@ class Session {
255255

256256
/**
257257
* Update value of the last bookmark.
258-
* @param {Bookmark} newBookmark the new bookmark.
258+
* @param {Bookmark} newBookmark - The new bookmark.
259259
*/
260260
_updateBookmark (newBookmark) {
261261
if (newBookmark && !newBookmark.isEmpty()) {

src/spatial-types.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ const POINT_IDENTIFIER_PROPERTY = '__isPoint__'
2727
export class Point {
2828
/**
2929
* @constructor
30-
* @param {Integer|number} srid the coordinate reference system identifier.
31-
* @param {number} x the `x` coordinate of the point.
32-
* @param {number} y the `y` coordinate of the point.
33-
* @param {number} [z=undefined] the `z` coordinate of the point or `undefined` if point has 2 dimensions.
30+
* @param {Integer|number} srid - The coordinate reference system identifier.
31+
* @param {number} x - The `x` coordinate of the point.
32+
* @param {number} y - The `y` coordinate of the point.
33+
* @param {number} [z=undefined] - The `z` coordinate of the point or `undefined` if point has 2 dimensions.
3434
*/
3535
constructor (srid, x, y, z) {
3636
/**
3737
* The coordinate reference system identifier.
38-
* @type {Integer|Number}
38+
* @type {Integer|number}
3939
*/
4040
this.srid = assertNumberOrInteger(srid, 'SRID')
4141
/**

0 commit comments

Comments
 (0)