我正在使用 neo4j 批处理操作端点。如果之前没有索引属性,我想将属性索引到现有节点,即。我正在使用这个端点,但使用?uniqueness=get_or_create
标志除外。
它有效,当我为两个不同的节点连续发出两个这样的批处理请求时,第二个永远不会被索引!
这是两个批处理请求的有效负载:
FIRST ONE:
[
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'registeredInShop',
value: '52a5f4e19e3fc8406a000006'
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'idInShop',
value: '1'
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'email',
value: 'me@shop.com'
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'createdOn',
value: 1386607841880
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'attributes_isSpam',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'attributes_isHardBounced',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'attributes_isSubscribedAlerts',
value: true
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'attributes_isSubscribed',
value: true
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'attributes_isCustomer',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'id',
value: '52a5f4e19e3fc8406a000008'
}
}
]
// SECOND ONE
[
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'registeredInShop',
value: '52a5f4e19e3fc8406a000006'
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'email',
value: 'me2@shop.com'
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'createdOn',
value: 1386607842460
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'attributes_isSpam',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'attributes_isHardBounced',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'attributes_isSubscribedAlerts',
value: true
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'attributes_isSubscribed',
value: true
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'attributes_isCustomer',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'id',
value: '52a5f4e29e3fc8406a000016'
}
}
]
关于为什么会发生这种情况的任何想法?如果我删除uniqueness=get_or_create
它就可以了,但这正是我想要实现的!