Very new user of Dgraph here but so far, loving it!
I’ve encountered a really strange bug(?) it seems
In my schema I have: Product.facts [string]
const createProduct = new Mutation();
const x = {
"dgraph.type": "Product",
"Product.attributes": "{\"string\":\"42\",\"number\":42,\"nested\":{\"nested\":\"property\"},\"boolean\":false}",
"Product.brand": {
"uid": "0x24f"
},
"Product.facts": [
"test fact #1",
"test fact #2",
"test fact #3"
],
"Product.media": [],
"Product.name": "test product name",
"Product.subtitle": "test product subtitle",
"Product.description": "test product description",
"uid": "_:product"
}
createProduct.setSetJson(x);
createProduct.setCommitNow(true);
const clientStub = new DgraphClientStub(<dgraph-url>, grpc.credentials.createInsecure());
const client = new DgraphClient(clientStub);
client.setDebugMode(true)
const productId = await client.newTxn()
.mutate(createProduct)
.then(r => r.getUidsMap().get('product'))
Then I go to Ratel and check the inserted object, and I see:
{
node(func: uid(<product ID>)) {
Product.facts
}
}
And I see:
"Product.facts": [
"test fact #2",
"test fact #1",
"test fact #3"
]
Why are strings out of order?