如sql server中表test 包含字段id, name, description ,其中ID 是整型唯一(可以是自增)。 在使用的时候让ID和mongodb中的数据一致呢?我们按正常的操作,例如sql test中有一条记录 (insert into test(1,'ray','冯的博客')),把这条数据同步到mongo。
mongo插入数据格式如下:
{
"ID" : 1,
"Name" : "ray",
"Description" : "冯的博客"
}
同步的结果如下图:
我们发现多了一个"_id"