首页 > 解决方案 > Is there a way to persist a field in Elasticsearch but not in mongodb?

问题描述

I am using both elasticsearch and mongodb in my project. I am looking for functionality similar to using @Transient, in the sense that the field should not persisted in mongodb, but can be in elasticsearch.

Public class pojo{
   @PersistInBothESAndMongo
   String field1;
   @PersistOnlyInES
   String field2;
}

标签: springmongodbspring-bootelasticsearchspring-data-rest

解决方案


推荐阅读