Ticker

6/recent/ticker-posts

Ad Code

Responsive Advertisement

mongotemplate 1:n关联查询时,多端的日期如何格式化?

如A一对多B,我现在通过关联查询,如何格式化B的日期?

A是主表,所以非常好格式化,通过:

.andExpression("{ $dateToString: {date: '$updatedDt', format: '%Y-%m-%d %H:%M:%S', timezone: '+08:00'}}").as("updatedDt");

但是B是副表,会有多条数据,那么如何操作呢?

Enregistrer un commentaire

0 Commentaires