I have a mongo collection and somewhere in the collection, here is an example of an entry in there to demonstrate the schema

cfrs0:PRIMARY> db.getCollection('organization').findOne({\_id:'gaiusadvocaten'})
{
 "\_id" : "gaiusadvocaten",
 "reseller" : DBRef("reseller", "688a3f46-4cc2-46c6-8bba-689cec575447"),
 "version" : NumberLong(8),
 "bucketName" : "cloudfinder-prod-app",
 "indexName" : "gaiusadvocaten",
 "indexSchemaVersion" : "SINGLE\_TYPE\_ES6",
 "needsUpdateTimestamp" : false,
 "wrongSourceIdIndexMapping" : false,
 "notForResale" : false,
 "providers" : [
 {
 "office365Domain" : "GaiusLaw.onmicrosoft.com",
 "scanNewUsers" : true,
 "scanNewSites" : true,
 "scanNewTeams" : true,
 "sharePointFullWebUrl" : "https://gaiuslaw.sharepoint.com/",
 "maxNumberOfUsers" : NumberLong(-1),
 "shouldSetOneDriveAdministrator" : false,
 "azure20Authorized" : true,
 "teamsAuthorized" : true,
 "usesOAuth" : true,
 "mailGraphApiBeta" : false,
 "exchange3" : false,
 "archiveGraphApi" : true,
 "contactsGraphApi" : true,
 "contactsGraphApiBeta" : false,
 "calendarGraphApi" : true,
 "calendarGraphApiBeta" : false,
 "calendarGraphApiBetaDelta" : false,
 "sharePointGraphApiBeta" : false,
 "sp20Rollback" : false,
 "sp3" : false,
 "skipExternalUsers" : true,
 "skipSharedMailboxes" : false,
 "updateDriveName" : false,
 "approved" : true,
 "inTrial" : false,
 "providerConfigId" : "GaiusLaw.onmicrosoft.com",
 "upgradedToFullAt" : ISODate("2022-12-02T17:41:17.008Z"),
 "disabled" : true,
 "trialHalfTimeNotificationHasBeenSent" : false,
 "trialFiveDaysLeftNotificationHasBeenSent" : false,
 "trialOneDayLeftNotificationHasBeenSent" : false,
 "trialExpiryNotificationHasBeenSent" : false,
 "notApprovedNotificationHasBeenSent" : false,
 "expiredEventTriggered" : false,
 "createdDate" : ISODate("2022-12-02T17:41:16.955Z"),
 "connectors" : {
 "office365skydrive" : {
 "disabled" : false
 },
 "office365onedrive20" : {
 "disabled" : false
 },
 "office365archive" : {
 "disabled" : true
 },
 "office365teams" : {
 "disabled" : true
 },
 "office365calendar" : {
 "disabled" : false
 },
 "office365contacts" : {
 "disabled" : false
 },
 "office365mail" : {
 "disabled" : false
 },
 "office365sharepoint20" : {
 "disabled" : false
 }
 },
 "properties" : {
 "organizationId" : "gaiusadvocaten",
 "providerId" : "office365",
 "providerConfigId" : "GaiusLaw.onmicrosoft.com",
 "office365teamsFullScanSyncDone" : "true"
 },
 "autoSelectNewUsers" : false,
 "\_class" : "cloudfinder.connector.office365.Office365ProviderConfig"
 }
 ],
 "receiveNotificationDisabled" : true,
 "createdDate" : ISODate("2022-12-02T17:40:14.629Z"),
 "trialInfoChecked" : false,
 "organizationSize" : "0",
 "country" : "Belgium",
 "organizationName" : "Gaius Advocaten",
 "state" : "Vlaams-Brabant",
 "zip" : "",
 "phone" : "",
 "billing" : {
 "billingType" : "MONTHLY\_IN\_ARREARS",
 "billingContact" : {
 "name" : "",
 "email" : "",
 "phone" : ""
 }
 },
 "isBrandNewOrganization" : true,
 "minimumCommit" : 0,
 "providersLimit" : 1,
 "lastManualReportGeneratedDate" : ISODate("2023-03-29T07:42:51.993Z"),
 "latestIndexStatistics" : {
 "document" : {
 "size" : 176174921457,
 "count" : NumberLong(453871),
 "aggregates" : {
 "exposure" : [
 {
 "value" : "NotExposed",
 "count" : NumberLong(453871)
 }
 ]
 }
 },
 "contact" : {
 "size" : 0,
 "count" : NumberLong(0),
 "aggregates" : {

 }
 },
 "collection" : {
 "size" : 0,
 "count" : NumberLong(0),
 "aggregates" : {
 "exposure" : [ ]
 }
 },
 "event" : {
 "size" : 2562789,
 "count" : NumberLong(812),
 "aggregates" : {

 }
 },
 "email" : {
 "size" : 1904036,
 "count" : NumberLong(18),
 "aggregates" : {
 "exposure" : [
 {
 "value" : "Internal",
 "count" : NumberLong(18)
 }
 ]
 }
 }
 },
 "lastCachedDashboard" : ISODate("2023-03-24T21:16:32.066Z")
}

I believe that an entry has been updated to a data type that my java app did not expect. for example, we have some fields where we only boot boolean values, but it is possible to put a string value in there and mess everything up

For individual fields with that particular variation of data type issues, we've just done eg. like db.organization.distinct("providers.0.disabled") to verify that particular field only has those particular two values. But the problem could affect any field, and could affect data types that would not avail themselves of .distinct()

can you come up with a query that will show us, say, for each field we have, a list of the different data types that any documents are using for that particular field?
몽고 컬렉션이 있고 컬렉션의 어딘가에 스키마를 보여주기 위한 항목의 예는 다음과 같습니다.cfrs0:PRIMARY> db.getCollection('organization').findOne({\_id:'gaiusadvocaten'}){ "\_id" : "gaiusadvocaten", "reseller" : DBRef("reseller", "688a3f46-4cc2-46c6-8bba-689cec575447"), "version" : NumberLong(8), "bucketName" : "cloudfinder-prod-app", "indexName" : "gaiusadvocaten", "indexSchemaVersion" : "SINGLE\_TYPE\_ES6", "needsUpdateTimestamp" : false, "wrongSourceIdIndexMapping" : false, "notForResale" : false, "providers" : [ { "office365Domain" : "GaiusLaw.onmicrosoft.com", "scanNewUsers" : true, "scanNewSites" : true, "scanNewTeams" : true, "sharePointFullWebUrl" : "https://gaiuslaw.sharepoint.com/", "maxNumberOfUsers" : NumberLong(-1), "shouldSetOneDriveAdministrator" : false, "azure20Authorized" : true, "teamsAuthorized" : true, "usesOAuth" : true, "mailGraphApiBeta" : false, "exchange3" : false, "archiveGraphApi" : true, "contactsGraphApi" : true, "contactsGraphApiBeta" : false, "calendarGraphApi" : true, "calendarGraphApiBeta" : false, "calendarGraphApiBetaDelta" : false, "sharePointGraphApiBeta" : false, "sp20롤백" : false, "sp3" : false, "skipExternalUsers" : true, "skipSharedMailboxes" : false, "updateDriveName" : false, "approved" : true, "inTrial" : false, "providerConfigId" : "GaiusLaw.onmicrosoft.com", "upgradedToFullAt" : ISODate("2022-12-02T17:41:17.008Z"), "disabled" : true, "trialHalfTimeNotificationHasBeenSent" : false, "trialFiveDaysLeftNotificationHasBeenSent" : false, "trialOneDayLeftNotificationHasBeenSent" : false, "trialExpiryNotificationHasBeenSent" : false, "notApprovedNotificationHasBeenSent" : false, "expiredEventTriggered" : false, "createdDate" : ISODate("2022-12-02T17:41:16.955Z"), "커넥터" : { "office365skydrive" : { "disabled" : false }, "office365onedrive20" : { "disabled" : false }, "office365archive" : { "disabled" : true }, "office365teams" : { "disabled" : true }, "office365calendar" : { "disabled" : false }, "office365contacts" : { "disabled" : false }, "office365mail" : { "disabled" : false }, "office365sharepoint20" : { "disabled" : false } }, "properties" : { "organizationId" : "gaiusadvocaten", "providerId" : "office365", "providerConfigId" : "GaiusLaw.onmicrosoft.com", "office365teamsFullScanSyncDone" : "true" }, "autoSelectNewUsers" : false, "\_class" : "cloudfinder.connector.office365.Office365ProviderConfig" } ], "receiveNotificationDisabled" : true, "createdDate" : ISODate("2022-12-02T17:40:14.629Z"), "trialInfoChecked" : false, "organizationSize" : "0", "country" : "벨기에", "organizationName" : "가이우스 어드보카텐", "state" : "Vlaams-Brabant", "zip" : "", "phone" : "", "billing" : { "billingType" : "MONTHLY\_IN\_ARREARS", "billingContact" : { "name" : "", "email" : "", "phone" : "" } }, "isBrandNewOrganization" : true, "minimumCommit" : 0, "providersLimit" : 1, "lastManualReportGeneratedDate" : ISODate("2023-03-29T07:42:51.993Z"), "latestIndexStatistics" : { "document" : { "size" : 176174921457, "count" : NumberLong(453871), "aggregates" : { "exposure" : [ { "value" : "NotExposed", "count" : NumberLong(453871) } ] } }, "contact" : { "size" : 0, "count" : NumberLong(0), "aggregates" : { } }, "collection" : { "size" : 0, "count" : NumberLong(0), "aggregates" : { "exposure" : [ ] } }, "event" : { "size" : 2562789, "count" : NumberLong(812), "aggregates" : { } }, "email" : { "size" : 1904036, "count" : NumberLong(18), "aggregates" : { "exposure" : [ { "value" : "내부", "count" : NumberLong(18) } ] } } }, "lastCachedDashboard" : ISODate("2023-03-24T21:16:32.066Z")}예를 들어, 부울 값만 부팅하는 일부 필드가 있는데, 여기에 문자열 값을 넣으면 모든 것이 엉망이 될 수 있습니다.이러한 특정 데이터 유형 문제가 있는 개별 필드의 경우, 예를 들어 db.organization.distinct("providers.0.disabled")와 같이 특정 필드에 특정 두 값만 있는지 확인했습니다. 그러나 이 문제는 모든 필드에 영향을 미칠 수 있으며 .distinct()를 사용할 수 없는 데이터 유형에도 영향을 미칠 수 있습니다.를 사용할 수 없는 데이터 유형에도 영향을 미칠 수 있는데, 예를 들어 각 필드에 대해 문서가 해당 특정 필드에 사용하고 있는 다양한 데이터 유형 목록을 보여주는 쿼리를 생각해낼 수 있나요?