Functions to get, query and manipulate nodes.
Example
var nodeLib = require('/lib/xp/node');
Classes
Methods
(static) connect(params) → {RepoConnection}
Creates a connection to a repository with a given branch and authentication info.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | JSON with the parameters. Properties
|
Returns:
Returns a new repo-connection.
- Type
- RepoConnection
Example
// Connect to repo 'myRepo', branch 'master'.
var myRepo = nodeLib.connect({
repoId: 'my-repo',
branch: 'master',
principals: ["role:system.admin"]
});
myRepo.create({
_name: "myName",
displayName: "This is brand new node"
});