Hi,
creating unique index is only supported during collection creation time if PITR is enabled, refer the sample here
https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/custom-commands#create-collection
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Database version : 3.6
Point in time restore is enabled.
"disableKeyBasedMetadataWriteAccess": false,
I have empty collection which has only "_id" unique index created by default, I can not create any new unique index in any of the collection.
Error=13, Details='Response status code does not indicate success: Forbidden (403); Substatus: 0; ActivityId: 9c6af975-b19c-47a2-8677-8eee31ba6184; Reason: (Message: {"Errors":["The unique index cannot be modified. To change the unique index, remove the collection and re-create a new one."]} ActivityId: 9c6af975-b19c-47a2-8677-8eee31ba6184, Request URI: /apps/fd26e62a-736a-496e-91f9-7bc6fe50de9f/services/5d74aaa7-13e1-449a-9d1e-fbd352b326ff/partitions/ceb8c238-67f7-487f-9fc7-3bd0ec6231fb/replicas/133415130048834580p, RequestStats: RequestStartTime: 2023-11-09T13:16:11.1729439Z, RequestEndTime: 2023-11-09T13:16:11.3527321Z, Number of regions attempted:1 {"systemHistory":[{"dateUtc":"2023-11-09T13:15:16.7652701Z","cpu":0.683,"memory":647573852.000,"threadInfo":{"isThreadStarving":"False","threadWaitIntervalInMs":0.0378,"availableThreads":32764,"minThreads":64,"maxThreads":32767},"numberOfOpenTcpConnection":464},{"dateUtc":"2023-11-09T13:15:26.7752798Z","cpu":0.526,"memory":647580008.000,"threadInfo":{"isThreadStarving":"False","threadWaitIntervalInMs":0.3445,"availableThreads":32764,"minThreads":64,"maxThreads":32767},"numberOfOpenTcpConnection":464},{"dateUtc":"2023-11-09T13:15:36.7851012Z","cpu":0.432,"memory":647561392.000,"threadInfo":{"isThreadStarving":"False","threadWaitIntervalInMs":0.2537,"availableThreads":32764,"minThreads":64,"maxThreads":32767},"numberOfOpenTcpConnection":471},{"dateUtc":"2023-11-09T13:15:46.7947505Z","cpu":0.305,"memory":647560420.000,"threadInfo":{"isThreadStarving":"False","threadWaitIntervalInMs":0.0951,"availableThreads":32764,"minThreads":64,"maxThreads":32767},"numberOfOpenTcpConnection":471},{"dateUtc":"2023-11-09T13:15:56.8046794Z","cpu":0.634,"memory":647548532.000,"threadInfo":{"isThreadStarving":"False","threadWaitIntervalInMs":0.0853,"availableThreads":32764,"minThreads":64,"maxThreads":32767},"numberOfOpenTcpConnection":471},{"dateUtc":"2023-11-09T13:16:06.8144520Z","cpu":0.351,"memory":647462616.000,"threadInfo":{"isThreadStarving":"False","threadWaitIntervalInMs":0.28,"availableThreads":32764,"minThreads":64,"maxThreads":32767},"numberOfOpenTcpConnection":471}]} RequestStart: 2023-11-09T13:16:11.1729690Z; ResponseTime: 2023-11-09T13:16:11.3527321Z; StoreResult: StorePhysicalAddress: rntbd://10.0.1.12:11300/apps/fd26e62a-736a-496e-91f9-7bc6fe50de9f/services/5d74aaa7-13e1-449a-9d1e-fbd352b326ff/partitions/ceb8c238-67f7-487f-9fc7-3bd0ec6231fb/replicas/133415130048834580p, LSN: 65, GlobalCommittedLsn: 65, PartitionKeyRangeId: , IsValid: True, StatusCode: 403, SubStatusCode: 0, RequestCharge: 2.81, ItemLSN: -1, SessionToken: -1#65, UsingLocalLSN: False, TransportException: null, BELatencyMs: 178.431, ActivityId: 9c6af975-b19c-47a2-8677-8eee31ba6184, RetryAfterInMs: , ReplicaHealthStatuses: [(port: 11300 | status: Connected | lkt: 11/9/2023 1:02:20 PM)], TransportRequestTimeline: {"requestTimeline":[{"event": "Created", "startTimeUtc": "2023-11-09T13:16:11.1729698Z", "durationInMs": 0.0078},{"event": "ChannelAcquisitionStarted", "startTimeUtc": "2023-11-09T13:16:11.1729776Z", "durationInMs": 0.0034},{"event": "Pipelined", "startTimeUtc": "2023-11-09T13:16:11.1729810Z", "durationInMs": 0.1006},{"event": "Transit Time", "startTimeUtc": "2023-11-09T13:16:11.1730816Z", "durationInMs": 179.1238},{"event": "Received", "startTimeUtc": "2023-11-09T13:16:11.3522054Z", "durationInMs": 0.1643},{"event": "Completed", "startTimeUtc": "2023-11-09T13:16:11.3523697Z", "durationInMs": 0}],"serviceEndpointStats":{"inflightRequests":1,"openConnections":1},"connectionStats":{"waitforConnectionInit":"False","callsPendingReceive":0,"lastSendAttempt":"2023-11-09T13:16:10.3551444Z","lastSend":"2023-11-09T13:16:10.3551564Z","lastReceive":"2023-11-09T13:16:10.3872475Z"},"requestSizeInBytes":32603,"requestBodySizeInBytes":32070,"responseMetadataSizeInBytes":171,"responseBodySizeInBytes":126}; ResourceType: Collection, OperationType: Replace , SDK: Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum, Windows/10.0.17763 cosmos-netstandard-sdk/3.18.0);
tried even recreating database, still no luck.
Hi,
creating unique index is only supported during collection creation time if PITR is enabled, refer the sample here
https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/custom-commands#create-collection