我的文件是
{sequence: 0, section: A}
{sequence: 1, section: B}
{sequence: 2, section: C}
{sequence: 3, section: F}
{sequence: 4, section: D}
{sequence: 5, section: E}
现在我想按部分对它们进行排序,并从序列X开始返回2个元素。
例如,排序后的文档是:
{sequence: 0, section: A}
{sequence: 1, section: B}
{sequence: 2, section: C}
{sequence: 4, section: D}
{sequence: 5, section: E}
{sequence: 3, section: F}
对于序列5 => (E和F部分) 对于序列1 => (B和C部分)
我可以使用mongodb查询吗?
谢谢。