Example #1
0
        static public MongoIndex ConvertPSMongoIndexToMongoIndex(PSMongoIndex psMongoIndex)
        {
            MongoIndex mongoIndex = new MongoIndex();

            if (psMongoIndex.Key != null)
            {
                mongoIndex.Key = PSMongoIndexKeys.ConvertPSMongoIndexKeysToMongoIndexKeys(psMongoIndex.Key);
            }

            if (psMongoIndex.Options != null)
            {
                mongoIndex.Options = PSMongoIndexOptions.CovertPSMongoIndexOptionsToMongoIndexOptions(psMongoIndex.Options);
            }

            return(mongoIndex);
        }
Example #2
0
        static public MongoIndex ToSDKModel(PSMongoIndex psMongoIndex)
        {
            if (psMongoIndex == null)
            {
                return(null);
            }

            MongoIndex mongoIndex = new MongoIndex();

            if (psMongoIndex.Key != null)
            {
                mongoIndex.Key = PSMongoIndexKeys.ToSDKModel(psMongoIndex.Key);
            }

            if (psMongoIndex.Options != null)
            {
                mongoIndex.Options = PSMongoIndexOptions.ToSDKModel(psMongoIndex.Options);
            }

            return(mongoIndex);
        }