monorepo 버전 준비
## @strpc 기존 RPC를 package화 ### @strpc/express express의 middleware + router 결함 ## @sammo 게임 전체 - server, client - gateway_server, gateway_client
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { Schema, model, Types } from 'mongoose';
|
||||
|
||||
interface ISchemaSequence {
|
||||
_id: Types.ObjectId;
|
||||
|
||||
collectionName: string;
|
||||
nextSeq: number;
|
||||
}
|
||||
|
||||
export const SchemaSequence = new Schema<ISchemaSequence>({
|
||||
collectionName: { type: String, required: true },
|
||||
nextSeq: {
|
||||
type: Number, required: true,
|
||||
get: (v: number) => Math.ceil(v),
|
||||
set: (v: number) => Math.ceil(v),
|
||||
default: 0,
|
||||
},
|
||||
|
||||
}, { autoIndex: true, autoCreate: true })
|
||||
.index({ collectionName: 1 }, { unique: true })
|
||||
;
|
||||
|
||||
export default model<ISchemaSequence>('SchemaSequence', SchemaSequence);
|
||||
Reference in New Issue
Block a user