Mutate schema in Ratel web mutation-terminal

Hi

How do I add/mutate schema in Ratel(http://localhost:8000/) web mutation-terminal?

I tried copying to the mutation terminal:

		email: string @index(exact) @upsert . # @index(hash) would also work
		pass: password .

And also:

{
  set {
		email: string @index(exact) @upsert . # @index(hash) would also work
		pass: password .
  }
}

Here an example.

1 Like

Thanks, I looked at that - and it works for me.

Is this also the best way to keep the schema in source control - copy and paste to and from a text file?

You can copy to wherever you want, but when using the Editor you must obey the correct syntax of Schema.

e.g:
Predicate (with angle brackets or not) + Type + if so: Indexing + dot notation

As a new (and excited) user, I too had this issue when trying to jump in ASAP to “kick the tires” with little to know knowledge of what to expect or how to do anything within the Ratel browser. The source of this initial confusion was when I hit the ‘Adding Indexes’ section of the Getting Started page (https://docs.dgraph.io/get-started/#adding-indexes). The basic instruction above on that page says to just copy/paste between the single-quotes if you are not using curl and want to work within the Ratel browser.

The issue seems to be that the curl url includes the ‘alter’ keyword (? suffix) and there does not appear to be anywhere in the Ratel browser for pasting and running this schema altering statement. Fortunately I was excited enough to keep poking around and stumbled on the Bulk Edit panel in the Schema tab and directly edited the entries there to include the alterations that would be done by this Getting Started curl expression.

Two possible solutions: 1) Update the Ratel Schema tab UI to include a panel to paste and run schema altering statements or (at least) tweak the instructions on the Getting Started page to explain the way to do the alteration within the existing Ratel browser.

Keep up the great work… As a Neo4j expat, I look forward to using this exciting technology and being a member of the community.

1 Like

Hi Salmons,

Thank for your comment. And welcome!

In fact Docs don’t shows how to use Ratel. In Ratel is slightly different in fact. Therefore Docs does not recommend a syntax to be used in Ratel. This you got there is just for alter operations via Alter endpoint. Can be made by cURL or HTTP client or gRPC client.

Alter painel was removed. And now is “bulk edit”.

I just did this for an hour and found out alter queries run in the way described above :smiley: Thanks @MichelDiz

1 Like