# Migrate a NodeBB forum with MongoDB to Discourse

**URL:** <https://meta.discourse.org/t/migrate-a-nodebb-forum-with-mongodb-to-discourse/126553>\
**Category:** Sysadmins\
**Tags:** how-to\
**Created:** [8월 22, 2019, 5:33오후 UTC](https://meta.discourse.org/t/migrate-a-nodebb-forum-with-mongodb-to-discourse/126553 "2019-08-22T17:33:06Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

**Author:** ![Twissell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/twissell/32/366765_2.png) [@Twissell](https://meta.discourse.org/u/Twissell)\
**Post date:** [3월 8, 2026, 2:39오후 UTC](https://meta.discourse.org/t/migrate-a-nodebb-forum-with-mongodb-to-discourse/126553/23 "2026-03-08T14:39:08Z")

</div>

_mongo.rb_ 파일에서 **posts** 메서드를 다시 작성했습니다

```plaintext
def posts(offset = 0, page_size = 1000)
post_keys = mongo.find(_key: “posts:pid”).sort(score: 1).skip(offset).limit(page_size).pluck(:value)
post_keys.map { |pid| post(pid)}.compact
end

```

이 접근 방식은 주제 내의 게시물이 올바른 시간 순서로 정렬되도록 보장합니다. 오름차순입니다.  
**sort(score: 1)** 호출에 주목하세요.

---

_[View the full topic](https://meta.discourse.org/t/migrate-a-nodebb-forum-with-mongodb-to-discourse/126553)._
