Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在NEventStore.Persistence.MongoDB中更改_id的类型?_Mongodb_Neventstore - Fatal编程技术网

如何在NEventStore.Persistence.MongoDB中更改_id的类型?

如何在NEventStore.Persistence.MongoDB中更改_id的类型?,mongodb,neventstore,Mongodb,Neventstore,默认情况下,NEventStore.Persistence.MongoDB使用Int64作为_id的默认类型,但是Int64有一个maxmium值,如果_id超过该maxmium值怎么办?(我知道很难够到,但会的) 我可以使用NEventStore将_id更改为Guid吗?记住Guid也有一个最大值。;)Int64的最大值为2^63-1(带符号)。如果你只保存了\u id,那就是8字节*2^63或73 EB或73000 1TB硬盘。。。我会关注使用int64的系统,因为它要么是一个瓶颈(计数器)

默认情况下,NEventStore.Persistence.MongoDB使用Int64作为_id的默认类型,但是Int64有一个maxmium值,如果_id超过该maxmium值怎么办?(我知道很难够到,但会的)


我可以使用NEventStore将_id更改为Guid吗?

记住Guid也有一个最大值。;)Int64的最大值为2^63-1(带符号)。如果你只保存了
\u id
,那就是8字节*2^63或73 EB或73000 1TB硬盘。。。我会关注使用int64的系统,因为它要么是一个瓶颈(计数器),要么使用HiLo,因此具有非单调键,这应该是一个更大的关注点。。。