本文介绍了JSON文档数据库中的键的成本(mongodb,elasticsearch)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人对文档存储数据库(如mongodb或elasticsearch)中的JSON键的大小有速度或优化效果方面有任何经验。

I would like if someone had any experience with speed or optimization effects on the size of JSON keys in a document store database like mongodb or elasticsearch.

:我有2个文档

 c。 findOne()并且看到 {_ id:1,t:13423,a:3,b:0.2} 完全存储在这里。 
  • 应用程序的可读性与数据库类似,但至少在这里你可以有一个解决方案。使用映射逻辑,将 currentDate 转换为 c 和 price 到 p ,您可以编写一个干净的代码并拥有一个简短的模式。

    • readability of the database. When you do db.coll.findOne() and sees {_id: 1, t: 13423, a: 3, b:0.2} it is pretty hard to understand what is exactly stored here.
    • readability of the application similar with the database, but at least here you can have a solution. With a mapping logic, which transforms currentDate to c and price to p you can write a clean code and have a short schema.

    这篇关于JSON文档数据库中的键的成本(mongodb,elasticsearch)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

    10-19 00:50