Skip to content

db collection들의 id값 변경에 관하여 #3

Description

@cloudgray

현재 db collection들의 식별자로, collection 생성시 자동 부여되는 _id값을 사용하고 있습니다.
(userId, cafeId 등)

그런데 이 _id값이 끝에 몇 자리만 바뀌는게 아무래도 db 인덱스인듯 하여 요청패스의 /:userId 로 노출시키기는 것이 좀 찝찝하더라고요.

이 값 대신에 random string으로 고유값을 생성해서 사용할까 합니다.

프론트에서 신경 쓸 부분은 크게 없다고 생각되지만 혹시 문제될만한 점이 있을까요?

웹토큰을 생성할 때 _id값이 들어가긴 하는데 프론트에서 웹토큰을 decode해서 쓸 일은 없죠?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions