How to place unique compound index into background with MongoDB?

26 views Asked by At

This is syntactically correct, but according to TS, this option is not supported:

@t.Unique("user-hash-device", ["hash", "userId", "deviceId"], {background: true})
@t.Entity('vibe_trace')                                    ///   ^^^^^^
export class Trace { 
   // ... 
}

(the above is not quite right, since it doesn't accept {background: true} there).

  1. is there a way to set a unique compound index to the background with mongodb?
  2. if so, how to declare that with TypeORM?
0

There are 0 answers