cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Write operations are not allowed for user 'neo4j' with FULL restricted to READ

I am trying this query

match (t:Trip),(s:User)
CALL apoc.when(exists((t)--(s)), 'create (h:hhh) return h', 'create (h:hhh) return h'
) yield value return value

but getting this error

Neo.ClientError.Security.Forbidden: Write operations are not allowed for user 'neo4j' with FULL restricted to READ.

I am using neo4j community version Version: 3.4.10 and apoc latest

1 ACCEPTED SOLUTION

for write statements you need to use call apoc.do.when() instead of call apoc.when()

View solution in original post

3 REPLIES 3

for write statements you need to use call apoc.do.when() instead of call apoc.when()

I m trying to write a custom apoc in which i am pulling the data from sql server and need to load in graph.

Result getData = graphDb.execute(
"call apoc.load.jdbc('jdbc:sqlserver://xxxxxxxxxxx','EXEC temp_procedure "
+ entitiyName + "') YIELD row with row.jsonstring as data return data");
Map<String, Object> getDataRow = new HashMap<>();
Map<String, Object> returnMap = new HashMap<>();
String dataString = "";
while (getData.hasNext()) {
getDataRow = getData.next();
dataString = getDataRow.get("data").toString();
Map<String, Object> getMapFromJson = JsonUtil.parse(dataString, "", Map.class);
String entityNameValue = (getMapFromJson.entrySet().iterator().next()).getKey();

		Result resultStr=graphDb.execute("with apoc.convert.fromJsonMap('"+dataString+"') as value unwind value."+entityNameValue+" as row create("+entityNameValue+":"+entityNameValue+") set "+ entityNameValue+"=row");
		returnMap.put(entityNameValue, entityNameValue);
		//returnMap.put((getMapFromJson.entrySet().iterator().next()).getKey(),	getMapFromJson.get((getMapFromJson.entrySet().iterator().next()).getKey()));

	}

If i am executing this i am getting below error
Neo.ClientError.Security.Forbidden: Write operations are not allowed for user 'neo4j' with roles [admin] restricted to READ.