You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I want to do
I want to use the @ id command as expected in the official document
What I did
add the @id tag in the schema,like below: mobile_number: String! @id @search(by: [hash, regexp])
successfully executed the import of the schema,and the ‘mobile_number’ field has tagged ‘upsert’ in rateUI web.
I successfully added a node with ‘mobile_number’ attribute value. Then I tried to add another node with the same ‘mobile_number’ value as the previously added node. My expectation is that the dgraph should have reported an error, causing the addition to fail because I have already added the @ id tag to the ‘mobile_number’ field. However, it was successfully added. Now there are two nodes of the same type with the same ‘mobile_number’ value successfully in the library.
May I ask why this is? Is there something wrong with my operation or configuration? Thank you to any friend who can help me. Thank you!
Dgraph metadata
docker run dgraph/standalone and rateUI , the version is v23.0.0
the result json content is :
I have used mutation addition in RateUI web and also added it using the official go client sdk. The results were all successfully added as described above. The key code added to used by go client sdk is as follows:
You have added a GraphQL schema. That's where we support @id feature. However the mutation you are doing is using DQL. It's a different language that we support to query data. This language doesn't support @id yet. You will need to do GraphQL mutations if you want to use the @id feature.
Question.
What I want to do
I want to use the @ id command as expected in the official document
What I did
add the @id tag in the schema,like below:
mobile_number: String! @id @search(by: [hash, regexp])
successfully executed the import of the schema,and the ‘mobile_number’ field has tagged ‘upsert’ in rateUI web.
I successfully added a node with ‘mobile_number’ attribute value. Then I tried to add another node with the same ‘mobile_number’ value as the previously added node. My expectation is that the dgraph should have reported an error, causing the addition to fail because I have already added the @ id tag to the ‘mobile_number’ field. However, it was successfully added. Now there are two nodes of the same type with the same ‘mobile_number’ value successfully in the library.
May I ask why this is? Is there something wrong with my operation or configuration? Thank you to any friend who can help me. Thank you!
Dgraph metadata
docker run dgraph/standalone and rateUI , the version is v23.0.0
the result json content is :
I have used mutation addition in RateUI web and also added it using the official go client sdk. The results were all successfully added as described above. The key code added to used by go client sdk is as follows:
The text was updated successfully, but these errors were encountered: