Skip to content

Commit 0417c2b

Browse files
Syncing proto files to support bg indexing and updated CHANGELOG for v20.03.0 release (#110)
* updated api.proto file and package files * Updating README docs and CHANGELOG Signed-off-by: Prashant Shahi <prashant@dgraph.io>
1 parent da44073 commit 0417c2b

File tree

7 files changed

+257
-399
lines changed

7 files changed

+257
-399
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [v20.03.0] - 2020-04-01
9+
10+
### Changed
11+
12+
- Synced proto files to latest version to support background indexing ([#110][])
13+
14+
[#110]: https://github.com/dgraph-io/dgraph-js/issues/110
15+
816
## [v2.1.0] - 2020-01-30
917

1018
### Fixed
@@ -138,6 +146,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
138146
### Added
139147
- Full compatibility with Dgraph v1.0.0
140148

149+
[v20.03.0]: https://github.com/dgraph-io/dgraph-js/compare/v2.1.0...v20.03.0
141150
[v2.1.0]: https://github.com/dgraph-io/dgraph-js/compare/v2.0.2...v2.1.0
142151
[v2.0.2]: https://github.com/dgraph-io/dgraph-js/compare/v2.0.1...v2.0.2
143152
[v2.0.1]: https://github.com/dgraph-io/dgraph-js/compare/v2.0.0...v2.0.1

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ use a different version of this client.
6565
|:--------------:|:-----------------:|
6666
| 1.0.X | *1.X.Y* |
6767
| 1.1.X | *2.X.Y* |
68+
| 20.03.0 | *20.03.0* |
6869

6970
Note: Only API breakage from *v1.X.Y* to *v2.X.Y* is in
7071
the function `DgraphClient.newTxn().mutate()`. This function returns a `messages.Assigned`
@@ -113,6 +114,19 @@ op.setSchema(schema);
113114
await dgraphClient.alter(op);
114115
```
115116

117+
Starting Dgraph version 20.03.0, indexes can be computed in the background.
118+
You can set `setRunInBackground` field of the `Operation` object to `true`
119+
before passing it to the `DgraphClient#alter(Operation)` method. You can find more details
120+
[here](https://docs.dgraph.io/master/query-language/#indexes-in-background).
121+
122+
```js
123+
const schema = "name: string @index(exact) .";
124+
const op = new dgraph.Operation();
125+
op.setSchema(schema);
126+
op.setRunInBackground(true);
127+
await dgraphClient.alter(op);
128+
```
129+
116130
> NOTE: Many of the examples here use the `await` keyword which requires
117131
> `async/await` support which is available on Node.js >= v7.6.0. For prior versions,
118132
> the expressions following `await` can be used just like normal `Promise`:
@@ -420,3 +434,4 @@ Make sure you have a Dgraph server running on localhost before you run this task
420434
```sh
421435
npm test
422436
```
437+

generated/api_pb.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ export class Operation extends jspb.Message {
189189
getDropValue(): string;
190190
setDropValue(value: string): void;
191191

192+
getRunInBackground(): boolean;
193+
setRunInBackground(value: boolean): void;
194+
192195
serializeBinary(): Uint8Array;
193196
toObject(includeInstance?: boolean): Operation.AsObject;
194197
static toObject(includeInstance: boolean, msg: Operation): Operation.AsObject;
@@ -206,6 +209,7 @@ export namespace Operation {
206209
dropAll: boolean,
207210
dropOp: Operation.DropOpMap[keyof Operation.DropOpMap],
208211
dropValue: string,
212+
runInBackground: boolean,
209213
}
210214

211215
export interface DropOpMap {

0 commit comments

Comments
 (0)