Skip to content

Commit

Permalink
Syncing proto files to support bg indexing and updated CHANGELOG for …
Browse files Browse the repository at this point in the history
…v20.03.0 release (#110)

* updated api.proto file and package files
* Updating README docs and CHANGELOG

Signed-off-by: Prashant Shahi <[email protected]>
  • Loading branch information
prashant-shahi authored Apr 2, 2020
1 parent da44073 commit 0417c2b
Show file tree
Hide file tree
Showing 7 changed files with 257 additions and 399 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [v20.03.0] - 2020-04-01

### Changed

- Synced proto files to latest version to support background indexing ([#110][])

[#110]: https://github.com/dgraph-io/dgraph-js/issues/110

## [v2.1.0] - 2020-01-30

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

[v20.03.0]: https://github.com/dgraph-io/dgraph-js/compare/v2.1.0...v20.03.0
[v2.1.0]: https://github.com/dgraph-io/dgraph-js/compare/v2.0.2...v2.1.0
[v2.0.2]: https://github.com/dgraph-io/dgraph-js/compare/v2.0.1...v2.0.2
[v2.0.1]: https://github.com/dgraph-io/dgraph-js/compare/v2.0.0...v2.0.1
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ use a different version of this client.
|:--------------:|:-----------------:|
| 1.0.X | *1.X.Y* |
| 1.1.X | *2.X.Y* |
| 20.03.0 | *20.03.0* |

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

Starting Dgraph version 20.03.0, indexes can be computed in the background.
You can set `setRunInBackground` field of the `Operation` object to `true`
before passing it to the `DgraphClient#alter(Operation)` method. You can find more details
[here](https://docs.dgraph.io/master/query-language/#indexes-in-background).

```js
const schema = "name: string @index(exact) .";
const op = new dgraph.Operation();
op.setSchema(schema);
op.setRunInBackground(true);
await dgraphClient.alter(op);
```

> NOTE: Many of the examples here use the `await` keyword which requires
> `async/await` support which is available on Node.js >= v7.6.0. For prior versions,
> the expressions following `await` can be used just like normal `Promise`:
Expand Down Expand Up @@ -420,3 +434,4 @@ Make sure you have a Dgraph server running on localhost before you run this task
```sh
npm test
```

4 changes: 4 additions & 0 deletions generated/api_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ export class Operation extends jspb.Message {
getDropValue(): string;
setDropValue(value: string): void;

getRunInBackground(): boolean;
setRunInBackground(value: boolean): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Operation.AsObject;
static toObject(includeInstance: boolean, msg: Operation): Operation.AsObject;
Expand All @@ -206,6 +209,7 @@ export namespace Operation {
dropAll: boolean,
dropOp: Operation.DropOpMap[keyof Operation.DropOpMap],
dropValue: string,
runInBackground: boolean,
}

export interface DropOpMap {
Expand Down
Loading

0 comments on commit 0417c2b

Please sign in to comment.