Neo4j在c中批量插入#

Neo4j在c中批量插入#,neo4j,Neo4j,我是Neo4j的新手,我使用c#(Neo4jClient)开发项目 在我的项目中,我希望一次创建大约3000个节点。现在我逐个节点创建单个节点,因为为了避免重复(即每次节点存在或不存在时,我都会检查。如果不存在,则创建节点。)。现在在neo4j中有16000个节点。因此,完成3000个节点需要2小时。 我想使用批插入。请与我共享代码,以便在此同时使用批插入来检查重复节点。提前谢谢。 公共类Neo4jDataProvider { IGraphClient _client=null; 公共Neo4j

我是Neo4j的新手,我使用c#(Neo4jClient)开发项目

在我的项目中,我希望一次创建大约3000个节点。现在我逐个节点创建单个节点,因为为了避免重复(每次节点存在或不存在时,我都会检查。如果不存在,则创建节点。)。现在在neo4j中有16000个节点。因此,完成3000个节点需要2小时。 我想使用批插入。请与我共享代码,以便在此同时使用批插入来检查重复节点。提前谢谢。

公共类Neo4jDataProvider
{
IGraphClient _client=null;
公共Neo4jDataProvider(IGraphClient客户端)
{
_客户=客户;
}
public void CreateAll(IEnumerable记录)
{
如果(_client!=null)
{
var propKey=string.Format(“{0}s”,typeof(T.Name.ToLower());
var query=_client.Cypher;
var createString=string.Format(({0}:{1}{{{2}}})”,“record”,typeof(T).Name,propKey);
query=query.Create(createString);
query=query.WithParam(propKey,records.ToList());
query.ExecuteWithoutResults();
}
}
}
public class Neo4jDataProvider<T>
    {
        IGraphClient _client = null;

        public Neo4jDataProvider(IGraphClient client)
        {
            _client = client;
        }

    public void CreateAll(IEnumerable<T> records)
    {
        if (_client != null)
        {
            var propKey = string.Format("{0}s", typeof (T).Name.ToLower());
            var query = _client.Cypher;
            var createString = string.Format("({0}:{1} {{{2}}})", "record", typeof(T).Name, propKey);
            query = query.Create(createString);
            query = query.WithParam(propKey, records.ToList());
            query.ExecuteWithoutResults();
        }
    }
}