1. Database
EggyByte Server
  • Default module
    • 项目介绍
    • 用户协议
    • 隐私政策
    • SuperDungeon
      • 超能魔盗团 隐私政策
      • User
        • Get User Data
        • Free Lottery
        • Paid Lottery
        • Sell Artwork
        • Find Top Users
        • Get Initial Data
        • Get Access
        • Change Name
      • Rank
        • Update
        • Find Top Users
      • Local
      • Remote
    • EggyByte
      • Account
        • Login
        • Register
        • Login Or Register
        • Access
        • Buy
        • Get Public Access
        • Formal Register
      • Game
        • Save Data
        • Load Data
      • Test
        • Random String
        • Get Map Json
      • Crypto
        • Compute Hash
        • Encrypt
        • Encrypt Map
        • Decrypt
      • Ad
        • Show
        • Debug
        • Impression Callback
      • User
        • Lock Test
        • Get User Data
        • Open Chest
      • Admin
        • Create Api Roles Copy
        • Create Api Roles Copy Copy
        • Delete Api Roles
        • Create Api Roles
      • Database
        • Update Mongo Users
          POST
        • List Databases
          POST
        • List Collections
          POST
        • List Mongo Users
          POST
        • Get Collection Stats
          POST
        • Get Collection Info
          POST
        • Get Paginated Documents
          POST
        • Create Mongo Users
          POST
        • Create Mongo Databases
          POST
      • Mailing
        • Send Mail
        • Send Captcha
        • Check Captcha
      • ThirdParty
        • Connect Url
        • Callback
        • Payment Link
    • 1
    • Untitled Endpoint
      GET
    • Untitled Endpoint
      POST
    • Setup
      POST
    • Create Database
      POST
    • Get Card
      GET
    • Create Question
      POST
    • Create Collection
      POST
    • Get Dashboards
      GET
    • Get Dashboard
      GET
    • Get Dashboard Copy
      POST
    • Untitled Endpoint
      GET
    • Untitled Endpoint
      GET
    • Schemas
      • 示例数据模型
        • Random Map
  • tester/v1/tester.proto
    • TesterService
      • List recent test runs with optional filtering.
      • Run a multi-service test suite in one request.
      • Run focused tests for a single service.
      • Retrieve a previously executed test run by ID.
    • Schemas
      • Schemas
        • protobufAny
        • rpcStatus
        • v1CrossServiceTestResult
        • v1GetTestRunResponse
        • v1ListTestRunsResponse
        • Standard pagination request
        • Standard pagination response
        • v1RunServiceTestsRequest
        • v1RunServiceTestsResponse
        • v1RunTestSuiteRequest
        • v1RunTestSuiteResponse
        • v1ServiceTestResult
        • v1TargetService
        • v1TestCaseResult
        • v1TestExecutionOptions
        • v1TestRun
        • v1TestRunStatus
        • v1TestRunSummary
  • auth/v1/auth.proto
    • AuthService
      • GetJWKS returns the JSON Web Key Set for token validation Used by Higress and other services to validate JWT tokens
      • GetOIDCDiscovery returns the OIDC discovery document Required for Higress OIDC plugin configuration
      • Authorize initiates the OAuth2/OIDC authorization flow Standard OIDC authorization endpoint for Higress integration
      • Authorize initiates the OAuth2/OIDC authorization flow Standard OIDC authorization endpoint for Higress integration
      • IntrospectToken validates and returns information about a token RFC 7662 - OAuth 2.0 Token Introspection (internal use only)
      • RevokeToken revokes an access or refresh token RFC 7009 - OAuth 2.0 Token Revocation
      • Token exchanges authorization code or refresh token for access tokens Standard OIDC token endpoint for Higress integration
      • GetUserInfo returns user information from a valid access token Standard OIDC UserInfo endpoint for Higress integration
      • GetUserInfo returns user information from a valid access token Standard OIDC UserInfo endpoint for Higress integration
      • ListUsers lists all users with auth information (admin only)
      • UpdateUserRole updates user's role (admin only)
      • SendEmailVerification sends email verification code
      • VerifyEmail verifies email with verification code
      • ResolveUserIdentity resolves JWT token and returns user identity context Called by Higress OIDC plugin to get user information for header injection
      • Login authenticates user credentials and returns tokens
      • Logout invalidates user tokens and sessions
      • ChangePassword changes user password (requires authentication)
      • ConfirmPasswordReset confirms password reset with code
      • ResetPassword initiates password reset flow
      • RefreshToken refreshes an access token using a refresh token
      • Register creates a new user account with authentication credentials
      • GetUserSessions retrieves active sessions for a user
      • RevokeUserSession revokes a specific user session
    • Schemas
      • Schemas
        • AuthServiceUpdateUserRoleBody
        • protobufAny
        • rpcStatus
        • v1AuthorizeError
        • v1AuthorizeRedirect
        • v1AuthorizeRequest
        • v1AuthorizeResponse
        • v1AuthorizeSuccess
        • v1ChangePasswordRequest
        • v1ChangePasswordResponse
        • v1ConfirmPasswordResetRequest
        • v1ConfirmPasswordResetResponse
        • v1GetJWKSResponse
        • v1GetOIDCDiscoveryResponse
        • v1GetUserInfoResponse
        • v1GetUserSessionsResponse
        • v1IntrospectTokenRequest
        • v1IntrospectTokenResponse
        • v1JWK
        • v1ListUsersResponse
        • v1LoginRequest
        • v1LoginResponse
        • v1LogoutRequest
        • v1LogoutResponse
        • v1RefreshTokenRequest
        • v1RefreshTokenResponse
        • v1RegisterRequest
        • v1RegisterResponse
        • v1ResetPasswordRequest
        • v1ResetPasswordResponse
        • Request to resolve user identity from JWT token (called by Higress OIDC plugin)
        • Response containing user identity context for injection into business microservices
        • v1RevokeTokenRequest
        • v1RevokeTokenResponse
        • v1RevokeUserSessionResponse
        • v1SendEmailVerificationRequest
        • v1SendEmailVerificationResponse
        • Token metadata for audit and debugging
        • v1TokenRequest
        • v1TokenResponse
        • v1UpdateUserRoleResponse
        • User identity information (injected by Higress gateway)
        • Core user information structure (simplified for cross-service use)
        • User roles in the EggyByte system
        • v1UserSession
        • User account status
        • v1VerifyEmailRequest
        • v1VerifyEmailResponse
  1. Database

Get Collection Stats

POST
/database/get-collection-stats

Request

Authorization
Add parameter in header
X-Access-Token
Example:
X-Access-Token: ********************
Query Params

Header Params

Body Params application/json

Example
{
    "id": "IWZf/t9DSXtV9veaEDJwRA==",
    "type": "user-data",
    "game_info": "super-dungeon@W6APYNmwbktFAmx6EeVAsqYUmMRr1Ezj:b5uNGyADIo9hXfjiuHDoitv8gAG0DSSi",
    "sign": "zdMKYGDcnOZPk1klG1dXPIc9RoUs9c/70AhRT4Zzi63P+78SndBsIGX9DlA8dGlAPlTBLeb7Jpkl2Ys9z6U3COzCgp4/JMKSfrBBwCPxZg4JH/nxTj1XY7Gnl4Asrgwgb+c9IH4qF0VKXS/Ta+S9xZhbAeVCSpXWrNs6Pl4OZ+Cc7aL36f5go05OsgQ6Cz8q9Ts5IZdWnqL8nhNxmyM4bpAWQby9Gz0EkG2bd6qV",
    "data": "{\"levelData\":{\"level\":1,\"exp\":0},\"registerTime\":0,\"lastLoadTime\":0}"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --globoff '/database/get-collection-stats?%20%60%3Cbutton%20class=%22btn%20btn-sm%20btn-secondary%22%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20onclick%3D%22dms.viewCollectionDocs(%27%24{dbName}%27%2C%20%27%24{colName}%27%2C%20%24{page%20-%201})%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%E4%B8%8A%E4%B8%80%E9%A1%B5%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fbutton%3E%60%20%3A%20%27%27}%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24{total%20%3E%20page%20*%2020%20%3F%20%60%3Cbutton%20class%3D%22btn%20btn-sm%20btn-secondary%20ms-2%22%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20onclick%3D%22dms.viewCollectionDocs(%27%24{dbName}%27%2C%20%27%24{colName}%27%2C%20%24{page%20+%201})%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%E4%B8%8B%E4%B8%80%E9%A1%B5%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fbutton%3E%60%20%3A%20%27%27}%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%60)%3B%20%20%20%20%20%20%20%20%20}%20catch%20(error)%20{%20%20%20%20%20%20%20%20%20%20%20%20%20this.showToast(%27%E8%8E%B7%E5%8F%96%E6%96%87%E6%A1%A3%E5%A4%B1%E8%B4%A5%27%2C%20%27danger%27)%3B%20%20%20%20%20%20%20%20%20}%20%20%20%20%20}%20%20%20%20%20%20%2F%2F%20%E6%96%B0%E5%A2%9E%E9%9B%86%E5%90%88%E5%88%9B%E5%BB%BA%E6%96%B9%E6%B3%95%20%20%20%20%20async%20createCollection(dbName)%20{%20%20%20%20%20%20%20%20%20const%20colName%20%3D%20prompt(%27%E8%AF%B7%E8%BE%93%E5%85%A5%E6%96%B0%E9%9B%86%E5%90%88%E5%90%8D%E7%A7%B0%EF%BC%9A%27)%3B%20%20%20%20%20%20%20%20%20if%20(!colName)%20return%3B%20%20%20%20%20%20%20%20%20%20try%20{%20%20%20%20%20%20%20%20%20%20%20%20%20await%20this.fetchAPI(%60create-collection%2F%24{dbName}%60%2C%20{%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20body%3A%20JSON.stringify({%20name%3A%20colName%20})%20%20%20%20%20%20%20%20%20%20%20%20%20})%3B%20%20%20%20%20%20%20%20%20%20%20%20%20this.showToast(%60%E9%9B%86%E5%90%88%20%24{colName}%20%E5%88%9B%E5%BB%BA%E6%88%90%E5%8A%9F%60%2C%20%27success%27)%3B%20%20%20%20%20%20%20%20%20%20%20%20%20this.fetchCollections()%3B%20%20%20%20%20%20%20%20%20}%20catch%20(error)%20{%20%20%20%20%20%20%20%20%20%20%20%20%20this.showToast(%60%E5%88%9B%E5%BB%BA%E5%A4%B1%E8%B4%A5%3A%20%24{error.message}%60%2C%20%27danger%27)%3B%20%20%20%20%20%20%20%20%20}%20%20%20%20%20}%20%20%20%20%20%20%2F%2F%20%E5%AE%8C%E5%96%84%E9%80%9A%E7%94%A8API%E8%AF%B7%E6%B1%82%E6%96%B9%E6%B3%95%EF%BC%88%E5%BC%BA%E5%88%B6POST%EF%BC%89%20%20%20%20%20async%20fetchAPI(endpoint%2C%20options%20%3D%20{})%20{%20%20%20%20%20%20%20%20%20try%20{%20%20%20%20%20%20%20%20%20%20%20%20%20const%20response%20%3D%20await%20fetch(%60%24{this.API_BASES[this.currentEnv]}%24{endpoint}%60%2C%20{%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20method%3A%20%27POST%27%2C%20%2F%2F%20%E5%BC%BA%E5%88%B6%E4%BD%BF%E7%94%A8POST%E6%96%B9%E6%B3%95%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20headers%3A%20{%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27X-Api-Key%27%3A%20this.API_KEY%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27Authorization%27%3A%20%60Basic%20%24{btoa(%60admin%3A%24{this.validPassword}%60)}%60%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27Content-Type%27%3A%20%27application%2Fjson%27%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20}%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20body%3A%20options.body%20%7C%7C%20null%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20...options%20%20%20%20%20%20%20%20%20%20%20%20%20})%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(!response.ok)%20{%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20errorText%20%3D%20await%20response.text()%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20Error(%60[%24{response.status}]%20%24{errorText}%60)%3B%20%20%20%20%20%20%20%20%20%20%20%20%20}%20%20%20%20%20%20%20%20%20%20%20%20%20return%20response.json()%3B%20%20%20%20%20%20%20%20%20}%20catch%20(error)%20{%20%20%20%20%20%20%20%20%20%20%20%20%20this.showToast(%60%E8%AF%B7%E6%B1%82%E5%A4%B1%E8%B4%A5%3A%20%24{error.message}%60%2C%20%27danger%27)%3B%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20error%3B%20%20%20%20%20%20%20%20%20}%20%20%20%20%20}%20%20%20%20%20%20%2F%2F%20%E6%96%B0%E5%A2%9E%E9%80%9A%E7%94%A8%E4%BF%A1%E6%81%AF%E5%BC%B9%E7%AA%97%20%20%20%20%20showInfoModal(content)%20{%20%20%20%20%20%20%20%20%20const%20modal%20%3D%20document.createElement(%27div%27)%3B%20%20%20%20%20%20%20%20%20modal.className%20%3D%20%27modal%20fade%27%3B%20%20%20%20%20%20%20%20%20modal.innerHTML%20%3D%20%60%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class%3D%22modal-dialog%20modal-lg%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class%3D%22modal-content%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class%3D%22modal-header%20bg-primary%20text-white%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ch5%20class%3D%22modal-title%22%3E%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF%3C%2Fh5%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cbutton%20type%3D%22button%22%20class%3D%22btn-close%22%20data-bs-dismiss%3D%22modal%22%3E%3C%2Fbutton%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class%3D%22modal-body%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24{content}%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%20%20%20%20%20%20%20%20%20%60%3B%20%20%20%20%20%20%20%20%20document.body.appendChild(modal)%3B%20%20%20%20%20%20%20%20%20new%20bootstrap.Modal(modal).show()%3B%20%20%20%20%20}%20%20%20%20%20%20%2F%2F%20%E6%96%B0%E5%A2%9E%E5%AD%97%E8%8A%82%E6%A0%BC%E5%BC%8F%E5%8C%96%E6%96%B9%E6%B3%95%20%20%20%20%20formatBytes(bytes)%20{%20%20%20%20%20%20%20%20%20if%20(bytes%20%3D%3D%3D%200)%20return%20%270%20Bytes%27%3B%20%20%20%20%20%20%20%20%20const%20k%20%3D%201024%3B%20%20%20%20%20%20%20%20%20const%20sizes%20%3D%20[%27Bytes%27%2C%20%27KB%27%2C%20%27MB%27%2C%20%27GB%27]%3B%20%20%20%20%20%20%20%20%20const%20i%20%3D%20Math.floor(Math.log(bytes)%20%2F%20Math.log(k))%3B%20%20%20%20%20%20%20%20%20return%20parseFloat((bytes%20%2F%20Math.pow(k%2C%20i)).toFixed(2))%20+%20%27%20%27%20+%20sizes[i]%3B%20%20%20%20%20}' \
--header 'X-Master-Key: {{master_key}}' \
--header 'X-Access-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": "IWZf/t9DSXtV9veaEDJwRA==",
    "type": "user-data",
    "game_info": "super-dungeon@W6APYNmwbktFAmx6EeVAsqYUmMRr1Ezj:b5uNGyADIo9hXfjiuHDoitv8gAG0DSSi",
    "sign": "zdMKYGDcnOZPk1klG1dXPIc9RoUs9c/70AhRT4Zzi63P+78SndBsIGX9DlA8dGlAPlTBLeb7Jpkl2Ys9z6U3COzCgp4/JMKSfrBBwCPxZg4JH/nxTj1XY7Gnl4Asrgwgb+c9IH4qF0VKXS/Ta+S9xZhbAeVCSpXWrNs6Pl4OZ+Cc7aL36f5go05OsgQ6Cz8q9Ts5IZdWnqL8nhNxmyM4bpAWQby9Gz0EkG2bd6qV",
    "data": "{\"levelData\":{\"level\":1,\"exp\":0},\"registerTime\":0,\"lastLoadTime\":0}"
}'

Responses

🟢200成功
text/plain
Modified at 2025-02-26 18:46:55
Previous
List Mongo Users
Next
Get Collection Info
Built with