Skip to content

JSDocs updates and fixes. #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ var writeTxResultPromise = session.writeTransaction(async txc => {
// used transaction will be committed automatically, no need for explicit commit/rollback

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

#### Writing integers

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

```javascript
var neo4j = require('neo4j-driver')

session.run('CREATE (n {age: {myIntParam}})', { myIntParam: neo4j.int(22) })
session.run('CREATE (n {age: $myIntParam})', { myIntParam: neo4j.int(22) })
```

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

```javascript
session.run('CREATE (n {age: {myIntParam}})', {
session.run('CREATE (n {age: $myIntParam})', {
myIntParam: neo4j.int('9223372036854775807')
})
```
Expand Down Expand Up @@ -505,7 +505,7 @@ To run tests against "default" Neo4j version:

To run tests against specified Neo4j version:

./runTests.sh '-e 3.1.3'
./runTests.sh '-e 4.0.0'

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

Expand Down
20 changes: 10 additions & 10 deletions src/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Driver {
*
* @public
* @param {Object} param - The object parameter
* @param {string} param.database - the target database to verify connectivity for.
* @param {string} param.database - The target database to verify connectivity for.
* @returns {Promise} promise resolved with server info or rejected with error.
*/
verifyConnectivity ({ database = '' } = {}) {
Expand All @@ -111,8 +111,8 @@ class Driver {
}

/**
* Returns whether the server supports multi database capabilities based on the handshaked protocol
* version.
* Returns whether the server supports multi database capabilities based on the protocol
* version negotiated via handshake.
*
* Note that this function call _always_ causes a round-trip to the server.
*
Expand All @@ -136,12 +136,12 @@ class Driver {
*
* @public
* @param {Object} param - The object parameter
* @param {string} param.defaultAccessMode=WRITE - the access mode of this session, allowed values are {@link READ} and {@link WRITE}.
* @param {string|string[]} param.bookmarks - the initial reference or references to some previous
* @param {string} param.defaultAccessMode=WRITE - The access mode of this session, allowed values are {@link READ} and {@link WRITE}.
* @param {string|string[]} param.bookmarks - The initial reference or references to some previous
* transactions. Value is optional and absence indicates that that the bookmarks do not exist or are unknown.
* @param {number} param.fetchSize - the record fetch size of each batch of this session.
* @param {number} param.fetchSize - The record fetch size of each batch of this session.
* Use {@link ALL} to always pull all records in one batch. This will override the config value set on driver config.
* @param {string} param.database - the database this session will operate on.
* @param {string} param.database - The database this session will operate on.
* @return {Session} new session.
*/
session ({
Expand Down Expand Up @@ -172,10 +172,10 @@ class Driver {
*
* @public
* @param {Object} param
* @param {string} param.defaultAccessMode=WRITE - the access mode of this session, allowed values are {@link READ} and {@link WRITE}
* @param {string|string[]} param.bookmarks - the initial reference or references to some previous transactions. Value is optional and
* @param {string} param.defaultAccessMode=WRITE - The access mode of this session, allowed values are {@link READ} and {@link WRITE}.
* @param {string|string[]} param.bookmarks - The initial reference or references to some previous transactions. Value is optional and
* absence indicates that the bookmarks do not exist or are unknown.
* @param {string} param.database - the database this session will operate on.
* @param {string} param.database - The database this session will operate on.
* @returns {RxSession} new reactive session.
*/
rxSession ({
Expand Down
34 changes: 17 additions & 17 deletions src/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ class Session {
* @protected
* @param {Object} args
* @param {string} args.mode the default access mode for this session.
* @param {ConnectionProvider} args.connectionProvider - the connection provider to acquire connections from.
* @param {Bookmark} args.bookmark - the initial bookmark for this session.
* @param {ConnectionProvider} args.connectionProvider - The connection provider to acquire connections from.
* @param {Bookmark} args.bookmark - The initial bookmark for this session.
* @param {string} args.database the database name
* @param {Object} args.config={} - this driver configuration.
* @param {boolean} args.reactive - whether this session should create reactive streams
* @param {number} args.fetchSize - defines how many records is pulled in each pulling batch
* @param {Object} args.config={} - This driver configuration.
* @param {boolean} args.reactive - Whether this session should create reactive streams
* @param {number} args.fetchSize - Defines how many records is pulled in each pulling batch
*/
constructor ({
mode,
Expand Down Expand Up @@ -91,8 +91,8 @@ class Session {
* @public
* @param {mixed} query - Cypher query to execute
* @param {Object} parameters - Map with parameters to use in query
* @param {TransactionConfig} [transactionConfig] - configuration for the new auto-commit transaction.
* @return {Result} - New Result
* @param {TransactionConfig} [transactionConfig] - Configuration for the new auto-commit transaction.
* @return {Result} New Result.
*/
run (query, parameters, transactionConfig) {
const { validatedQuery, params } = validateQueryAndParameters(
Expand Down Expand Up @@ -151,8 +151,8 @@ class Session {
*
* While a transaction is open the session cannot be used to run queries outside the transaction.
*
* @param {TransactionConfig} [transactionConfig] - configuration for the new auto-commit transaction.
* @returns {Transaction} - New Transaction
* @param {TransactionConfig} [transactionConfig] - Configuration for the new auto-commit transaction.
* @returns {Transaction} New Transaction.
*/
beginTransaction (transactionConfig) {
// this function needs to support bookmarks parameter for backwards compatibility
Expand Down Expand Up @@ -202,7 +202,7 @@ class Session {
/**
* Return the bookmark received following the last completed {@link Transaction}.
*
* @return {string[]} a reference to a previous transaction
* @return {string[]} A reference to a previous transaction.
*/
lastBookmark () {
return this._lastBookmark.values()
Expand All @@ -216,10 +216,10 @@ class Session {
* delay of 1 second and maximum retry time of 30 seconds. Maximum retry time is configurable via driver config's
* `maxTransactionRetryTime` property in milliseconds.
*
* @param {function(tx: Transaction): Promise} transactionWork - callback that executes operations against
* @param {function(tx: Transaction): Promise} transactionWork - Callback that executes operations against
* a given {@link Transaction}.
* @param {TransactionConfig} [transactionConfig] - configuration for all transactions started to execute the unit of work.
* @return {Promise} resolved promise as returned by the given function or rejected promise when given
* @param {TransactionConfig} [transactionConfig] - Configuration for all transactions started to execute the unit of work.
* @return {Promise} Resolved promise as returned by the given function or rejected promise when given
* function or commit fails.
*/
readTransaction (transactionWork, transactionConfig) {
Expand All @@ -235,10 +235,10 @@ class Session {
* delay of 1 second and maximum retry time of 30 seconds. Maximum retry time is configurable via driver config's
* `maxTransactionRetryTime` property in milliseconds.
*
* @param {function(tx: Transaction): Promise} transactionWork - callback that executes operations against
* @param {function(tx: Transaction): Promise} transactionWork - Callback that executes operations against
* a given {@link Transaction}.
* @param {TransactionConfig} [transactionConfig] - configuration for all transactions started to execute the unit of work.
* @return {Promise} resolved promise as returned by the given function or rejected promise when given
* @param {TransactionConfig} [transactionConfig] - Configuration for all transactions started to execute the unit of work.
* @return {Promise} Resolved promise as returned by the given function or rejected promise when given
* function or commit fails.
*/
writeTransaction (transactionWork, transactionConfig) {
Expand All @@ -255,7 +255,7 @@ class Session {

/**
* Update value of the last bookmark.
* @param {Bookmark} newBookmark the new bookmark.
* @param {Bookmark} newBookmark - The new bookmark.
*/
_updateBookmark (newBookmark) {
if (newBookmark && !newBookmark.isEmpty()) {
Expand Down
10 changes: 5 additions & 5 deletions src/spatial-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ const POINT_IDENTIFIER_PROPERTY = '__isPoint__'
export class Point {
/**
* @constructor
* @param {Integer|number} srid the coordinate reference system identifier.
* @param {number} x the `x` coordinate of the point.
* @param {number} y the `y` coordinate of the point.
* @param {number} [z=undefined] the `z` coordinate of the point or `undefined` if point has 2 dimensions.
* @param {Integer|number} srid - The coordinate reference system identifier.
* @param {number} x - The `x` coordinate of the point.
* @param {number} y - The `y` coordinate of the point.
* @param {number} [z=undefined] - The `z` coordinate of the point or `undefined` if point has 2 dimensions.
*/
constructor (srid, x, y, z) {
/**
* The coordinate reference system identifier.
* @type {Integer|Number}
* @type {Integer|number}
*/
this.srid = assertNumberOrInteger(srid, 'SRID')
/**
Expand Down
Loading