MongoDb query to access array json - json

EDIT:
INPUT : nodes DB is
db.nodes.insert([
{ "ACTIVE" : 1,
"GEOLOCATION": {
"GEO_CODE": [],
"ACTIVE_GEOLOCATION": false
},
"META": {
"CATEGORY": "levis",
"DESCRIPTION": "dsad",
"PRIVACY": "PUBLIC",
"TEMPLATE_NAME": "B",
"TEMPLATE_GROUP": "Product",
"KEYWORDS": [
"sda"
],
"CREATEDBY": "",
"SUBCATEGORY": "Blue",
"PRODUCT_TEMPLATE_TYPE": "Consumable",
"UOM": "",
"TEMPLATE_SUBGROUP": ""
},
"VARIENTS": [
{
"COMMENT": "Demo",
"INDEX": 0,
"NAME": "Brand",
"IS_PARENT": false,
"DATATYPE": "Text",
"ACCESS": "PUBLIC",
"PARENT_VARIENT": "Parem",
"TYPE": "PERMANENT"
},
{
"COMMENT": "Demo",
"INDEX": 0,
"NAME": "Account",
"IS_PARENT": false,
"DATATYPE": "Text",
"ACCESS": "PUBLIC",
"PARENT_VARIENT": "Parem",
"TYPE": "PERMANENT"
},
{
"COMMENT": "Demo",
"INDEX": 0,
"NAME": "Price",
"IS_PARENT": false,
"DATATYPE": "Text",
"ACCESS": "PUBLIC",
"PARENT_VARIENT": "Parem",
"TYPE": "PERMANENT"
},
]
}
])
Input:
if (Meteor.isServer) {
var nodeDB = new Meteor.Collection('nodes');
Meteor.startup(function () {
// code to run on server at startup
});
var p1=nodeDB.find({"ACTIVE" : 1, "VARIENTS.ACCESS" : "PUBLIC"}, { "VARIENTS.NAME": 1, _id : 0 });
var p2=p1.fetch();
var arr1=[];
var arr2=[];
for (i=0;i <p2.length;i++)
{
//console.log(p2[i].VARIENTS);
arr1[i]=p2[i].VARIENTS;
}
var dict=(arr1[1]);
// console.log(x.length);
console.log(arr1.NAME);
Meteor.startup(function () {
// code to run on server at startup
});
}
Result:
[ [ { COMMENT: 'Demo',
I20150521-15:50:47.855(5.5)? INDEX: 0,
I20150521-15:50:47.856(5.5)? NAME: 'Brand',
I20150521-15:50:47.856(5.5)? IS_PARENT: false,
I20150521-15:50:47.856(5.5)? DATATYPE: 'Text',
I20150521-15:50:47.856(5.5)? ACCESS: 'PUBLIC',
I20150521-15:50:47.856(5.5)? PARENT_VARIENT: 'Parem',
I20150521-15:50:47.856(5.5)? TYPE: 'PERMANENT' },
I20150521-15:50:47.856(5.5)? { COMMENT: 'Demo',
I20150521-15:50:47.857(5.5)? INDEX: 0,
I20150521-15:50:47.857(5.5)? NAME: 'Account',
I20150521-15:50:47.857(5.5)? IS_PARENT: false,
I20150521-15:50:47.857(5.5)? DATATYPE: 'Text',
I20150521-15:50:47.857(5.5)? ACCESS: 'PUBLIC',
I20150521-15:50:47.857(5.5)? PARENT_VARIENT: 'Parem',
I20150521-15:50:47.857(5.5)? TYPE: 'PERMANENT' },
I20150521-15:50:47.857(5.5)? { COMMENT: 'Demo',
I20150521-15:50:47.858(5.5)? INDEX: 0,
I20150521-15:50:47.858(5.5)? NAME: 'Price',
I20150521-15:50:47.858(5.5)? IS_PARENT: false,
I20150521-15:50:47.858(5.5)? DATATYPE: 'Text',
I20150521-15:50:47.858(5.5)? ACCESS: 'PUBLIC',
I20150521-15:50:47.858(5.5)? PARENT_VARIENT: 'Parem',
I20150521-15:50:47.859(5.5)? TYPE: 'PERMANENT' } ] ]
Problem: Result required is only NAME parameters in an array.How the query should be modified?

Mongo Query:-
db.nodes.aggregate([
{"$group": {"_id": "$VARIENTS.NAME"}},
{"$project": {"_id": 0, "TEMPLATE_NAME": "$_id"}}
]);
Mongo Result :-
{
"result" : [
{
"TEMPLATE_NAME" : [
"Brand",
"Account",
"Price"
]
}
],
"ok" : 1
}

Related

I bought the fluxstore program, connects via API to the WordPress site. The program works, but on the emulator it gives such an error

// ignore_for_file: prefer_single_quotes, lines_longer_than_80_chars final
Map<String, dynamic> environment = {
"appConfig": "lib/config/config_en.json",
"serverConfig": {
"url": "https://beno.az",
"type": "dokan",
"consumerKey": "ck_2d0aa8da524a99fee44e48e93b6c27cd278edd0f",
"consumerSecret": "cs_c284c006e0617ddf3b9e9dbabf630a5f1bd0715a"
},
"defaultDarkTheme": false,
"enableRemoteConfigFirebase": false,
"enableFirebaseAnalytics": false,
"loginSMSConstants": {
"nameDefault": "Azərbaycan",
"countryCodeDefault": "AZ",
"dialCodeDefault": "+994"
},
"phoneNumberConfig": {
"useInternationalFormat": true,
"customCountryList": [],
"dialCodeDefault": "+1",
"showCountryFlag": true,
"selectorFlagAsPrefixIcon": true,
"selectorType": "BOTTOM_SHEET",
"countryCodeDefault": "US",
"enablePhoneNumberValidation": false
},
"storeIdentifier": {
"ios": "1469772800",
"disable": true,
"android": "com.inspireui.fluxstore"
},
"advanceConfig": {
"DefaultLanguage": "az",
"DetailedBlogLayout": "halfSizeImageType",
"EnablePointReward": false,
"hideOutOfStock": false,
"HideEmptyTags": true,
"HideEmptyCategories": false,
"EnableRating": true,
"hideEmptyProductListRating": true,
"EnableCart": true,
"ShowBottomCornerCart": true,
"EnableSkuSearch": true,
"showStockStatus": true,
"GridCount": 3,
"isCaching": true,
"kIsResizeImage": true,
"httpCache": true,
"Currencies": [
{
"decimalDigits": 0,
"currency": "AZN",
"currencyCode": "AZN",
"symbolBeforeTheNumber": true,
"symbol": " ₼",
"smallestUnitRate": 1
}
],
"DefaultStoreViewCode": "",
"EnableAttributesConfigurableProduct": ["color", "size"],
"EnableAttributesLabelConfigurableProduct": ["color", "size"],
"isMultiLanguages": true,
"EnableApprovedReview": false,
"EnableSyncCartFromWebsite": false,
"EnableSyncCartToWebsite": false,
"EnableFirebase": false,
"RatioProductImage": 1.2,
"EnableCouponCode": true,
"ShowCouponList": true,
"ShowAllCoupons": true,
"ShowExpiredCoupons": true,
"AlwaysShowTabBar": false,
"PrivacyPoliciesPageId": null,
"PrivacyPoliciesPageUrl": "https://policies.google.com/",
"SupportPageUrl": "https://support.inspireui.com/",
"DownloadPageUrl": "https://mstore.io/#download",
"SocialConnectUrl": [
{
"name": "Facebook",
"url": "https://www.facebook.com/inspireui",
"icon": "assets/icons/logins/facebook.png"
},
{
"url": "https://www.instagram.com/inspireui9/",
"name": "Instagram",
"icon": "assets/icons/logins/instagram.png"
}
],
"AutoDetectLanguage": false,
"QueryRadiusDistance": 10,
"MinQueryRadiusDistance": 1,
"MaxQueryRadiusDistance": 10,
"EnableMembershipUltimate": false,
"EnablePaidMembershipPro": false,
"EnableDeliveryDateOnCheckout": false,
"EnableNewSMSLogin": true,
"EnableBottomAddToCart": false,
"inAppWebView": false,
"EnableWOOCSCurrencySwitcher": false,
"enableProductBackdrop": false,
"categoryImageMenu": true,
"EnableDigitsMobileLogin": false,
"OnBoardOnlyShowFirstTime": true,
"WebViewScript": "",
"EnableVersionCheck": false,
"AjaxSearchURL": "",
"AlwaysClearWebViewCache": false,
"AlwaysRefreshBlog": false,
"OrderNotesWithPrivateNote": true,
"OrderNotesLinkSupport": false,
"inAppUpdateForAndroid": {"typeUpdate": "flexible", "enable": false},
"categoryConfig": {"enableLargeCategories": false, "deepLevel": 3},
"pinnedProductTags": [],
"gdpr": {
"showPrivacyPolicyFirstTime": false,
"showDeleteAccount": true,
"confirmCaptcha": "PERMANENTLY DELETE"
},
"smsLoginAsDefault": false,
"DefaultCurrency": {
"symbolBeforeTheNumber": true,
"currencyCode": "AZN",
"smallestUnitRate": 1,
"decimalDigits": 0,
"symbol": " ₼",
"currency": "AZN"
},
"showRequestNotification": true
},
"defaultDrawer": {
"items": [
{"type": "home", "show": true},
{"show": true, "type": "blog"},
{"show": true, "type": "categories"},
{"type": "cart", "show": true},
{"type": "profile", "show": true},
{"show": true, "type": "login"},
{"show": true, "type": "category"}
],
"logo": "assets/images/logo.png"
},
"defaultSettings": [
"products",
"chat",
"wishlist",
"notifications",
"language",
"currencies",
"darkTheme",
"order",
"point",
"rating",
"privacy",
"about"
],
"loginSetting": {
"showGoogleLogin": true,
"facebookLoginProtocolScheme": "fb430258564493822",
"facebookAppId": "430258564493822",
"smsLoginAsDefault": false,
"showFacebook": false,
"requirePhoneNumberWhenRegister": true,
"showAppleLogin": false,
"showSMSLogin": true,
"facebookClientToken": "",
"isResetPasswordSupported": true,
"showPhoneNumberWhenRegister": true,
"IsRequiredLogin": true
},
"oneSignalKey": {
"appID": "8b45b6db-7421-45e1-85aa-75e597f62714",
"enable": false
},
"onBoardingData": [
{
"image": "https://i.imgur.com/0W12Sg5.png",
"desc": "Allış veriş artıq daha rahat oldu.",
"title": "BEN’O mobil tətbiqinə xoş gəlmisiniz"
},
{
"title": "Çatdırılma",
"image": "https://i.imgur.com/MfOH6LF.png",
"desc": "Siz əziyyət çəkməyin biz çatdırarıq"
},
{
"title": "Yeni dostlar edinin !",
"desc":
"Burada edindiyiniz dostlarınıza sevdiyi hər şeyi rahatlıqla əldə edə bilərsiniz.",
"image": "https://i.imgur.com/xdzO89M.png"
}
],
"vendorOnBoardingData": [
{
"title": "Welcome aboard",
"image": "assets/images/searching.png",
"desc": "Just a few more steps to become our vendor"
},
{
"title": "Let's Get Started",
"image": "assets/images/manage.png",
"desc": "Good Luck for great beginnings."
}
],
"adConfig": {
"ads": [],
"facebookTestingId": "",
"enable": false,
"googleTestingId": [],
"adMobAppIdIos": "ca-app-pub-7432665165146018~2664444130",
"adMobAppIdAndroid": "ca-app-pub-7432665165146018~2664444130"
},
"firebaseDynamicLinkConfig": {
"link": "https://mstore.io/",
"androidPackageName": "com.inspireui.fluxstore",
"uriPrefix": "https://fluxstoreinspireui.page.link",
"iOSAppStoreId": "1469772800",
"androidAppMinimumVersion": 1,
"isEnabled": true,
"iOSBundleId": "com.inspireui.mstore.flutter",
"iOSAppMinimumVersion": "1.0.1",
"shortDynamicLinkEnable": true
},
"languagesInfo": [
{
"icon": "assets/images/country/az.jpg",
"text": "Azərbaycan dili",
"code": "az",
"name": "Azerbaijani",
"storeViewCode": ""
},
{
"text": "English",
"icon": "assets/images/country/gb.png",
"name": "English",
"code": "en",
"storeViewCode": ""
},
{
"storeViewCode": "ru",
"text": "Русский",
"name": "Russian",
"icon": "assets/images/country/ru.png",
"code": "ru"
},
{
"name": "Turkish",
"storeViewCode": "tr",
"text": "Türkçe",
"icon": "assets/images/country/tr.png",
"code": "tr"
}
],
"paymentConfig": {
"excludedPaymentIds": [],
"EnableReview": true,
"EnableAlphanumericZipCode": false,
"EnableOnePageCheckout": true,
"CheckoutPageSlug": {"en": "checkout"},
"EnableRefundCancel": true,
"EnableCustomerNote": true,
"EnableCreditCard": false,
"GuestCheckout": true,
"EnableAddress": true,
"NativeOnePageCheckout": false,
"EnableShipping": true,
"allowSearchingAddress": true,
"SmartCOD": {"amountStop": 200, "enabled": false, "extraFee": 10},
"DefaultStateISOCode": "LA",
"RefundPeriod": 7,
"EnableAddressLocationNote": false,
"ShowOrderNotes": true,
"DefaultCountryISOCode": "AZ",
"UpdateOrderStatus": false
},
"payments": {
"paypal": "assets/icons/payment/paypal.svg",
"stripe_v2_google_pay": "https://i.imgur.com/XAGc92A.jpeg",
"stripe_v2_apple_pay": "https://i.imgur.com/dFQ8FKi.png",
"tap": "assets/icons/payment/tap.png",
"stripe": "assets/icons/payment/stripe.svg",
"razorpay": "assets/icons/payment/razorpay.svg"
},
"stripeConfig": {
"enabled": false,
"paymentMethodIds": ["stripe", "stripe"],
"enableApplePay": true,
"merchantCountryCode": "US",
"paymentMethodId": "stripe",
"serverEndpoint": "https://stripe-server-node.vercel.app",
"merchantDisplayName": "FluxStore",
"merchantIdentifier": "merchant.com.inspireui.mstore.flutter",
"publishableKey":
"pk_test_51HNabPCinksNdU0OwGkZ6uMdZOrLT42NGJkBxmVJwx3oM5mafpJaQRfDHifJMg2iREDZxbPkR1TvDtmBeTyjmgv200mCojR2dG",
"useV1": false,
"enableGooglePay": true,
"returnUrl": "fluxstore://inspireui.com",
"enableManualCapture": false
},
"paypalConfig": {
"secret":
"ECbFREri7NFj64FI_9WzS6A0Az2DqNLrVokBo0ZBu4enHZKMKOvX45v9Y1NBPKFr6QJv2KaSp5vk5A1G",
"nativeMode": false,
"paymentMethodId": "paypal",
"production": false,
"enabled": true,
"clientId":
"ASlpjFreiGp3gggRKo6YzXMyGM6-NwndBAQ707k6z3-WkSSMTPDfEFmNmky6dBX00lik8wKdToWiJj5w"
},
"razorpayConfig": {
"keyId": "rzp_test_SDo2WKBNQXDk5Y",
"enabled": true,
"keySecret": "RrgfT3oxbJdaeHSzvuzaJRZf",
"paymentMethodId": "razorpay"
},
"tapConfig": {
"paymentMethodId": "tap",
"SecretKey": "sk_test_XKokBfNWv6FIYuTMg5sLPjhJ",
"enabled": false
},
"mercadoPagoConfig": {
"production": false,
"enabled": true,
"paymentMethodId": "woo-mercado-pago-basic",
"accessToken":
"TEST-5726912977510261-102413-65873095dc5b0a877969b7f6ffcceee4-613803978"
},
"payTmConfig": {
"production": false,
"enabled": true,
"paymentMethodId": "paytm",
"merchantId": "your-merchant-id"
},
"payStackConfig": {
"enabled": true,
"production": false,
"paymentMethodId": "paystack",
"supportedCurrencies": ["ZAR"],
"publicKey": "pk_test_a1a37615c9ca90dead5dd84dedbb5e476b640a6f"
},
"flutterwaveConfig": {
"publicKey": "FLWPUBK_TEST-72b90e0734da8c9e43916adf63cd711e-X",
"production": false,
"enabled": true,
"paymentMethodId": "rave"
},
"myFatoorahConfig": {
"enabled": false,
"apiToken":
"rLtt6JWvbUHDDhsZnfpAhpYk4dxYDQkbcPTyGaKp2TYqQgG7FGZ5Th_WD53Oq8Ebz6A53njUoo1w3pjU1D4vs_ZMqFiz_j0urb_BH9Oq9VZoKFoJEDAbRZepGcQanImyYrry7Kt6MnMdgfG5jn4HngWoRdKduNNyP4kzcp3mRv7x00ahkm9LAK7ZRieg7k1PDAnBIOG3EyVSJ5kK4WLMvYr7sCwHbHcu4A5WwelxYK0GMJy37bNAarSJDFQsJ2ZvJjvMDmfWwDVFEVe_5tOomfVNt6bOg9mexbGjMrnHBnKnZR1vQbBtQieDlQepzTZMuQrSuKn-t5XZM7V6fCW7oP-uXGX-sMOajeX65JOf6XVpk29DP6ro8WTAflCDANC193yof8-f5_EYY-3hXhJj7RBXmizDpneEQDSaSz5sFk0sV5qPcARJ9zGG73vuGFyenjPPmtDtXtpx35A-BVcOSBYVIWe9kndG3nclfefjKEuZ3m4jL9Gg1h2JBvmXSMYiZtp9MR5I6pvbvylU_PP5xJFSjVTIz7IQSjcVGO41npnwIxRXNRxFOdIUHn0tjQ-7LwvEcTXyPsHXcMD8WtgBh-wxR8aKX7WPSsT1O8d8reb2aR7K3rkV3K82K_0OgawImEpwSvp9MNKynEAJQS6ZHe_J_l77652xwPNxMRTMASk1ZsJL",
"paymentMethodId": "myfatoorah_v2",
"accountCountry": "KW",
"production": false
},
"inAppPurchaseConfig": {
"subscriptionProductIDs": ["com.inspireui.fluxstore.subscription.test"],
"enabled": true,
"consumableProductIDs": ["com.inspireui.fluxstore.test"],
"nonConsumableProductIDs": []
},
"defaultCountryShipping": [],
"afterShip": {
"api": "e2e9bae8-ee39-46a9-a084-781d0139274f",
"tracking_url": "https://fluxstore.aftership.com"
},
"googleApiKey": {
"web": "AIzaSyDSNYVC-8DU9BTcyqkeN9c5pgVhwOBAvGg",
"android": "AIzaSyDSNYVC-8DU9BTcyqkeN9c5pgVhwOBAvGg",
"ios": "AIzaSyDSNYVC-8DU9BTcyqkeN9c5pgVhwOBAvGg"
},
"productDetail": {
"SliderShowGoBackButton": true,
"ForceWhiteBackground": false,
"showQuantityInList": false,
"showProductCategories": true,
"showVideo": true,
"AutoSelectFirstAttribute": true,
"showStockQuantity": true,
"hideInvalidAttributes": false,
"productImageLayout": "page",
"showSku": true,
"SliderIndicatorType": "number",
"autoPlayGallery": false,
"limitDayBooking": 14,
"attributeImagesSize": 50,
"showAddToCartInSearchResult": true,
"productListItemHeight": 125,
"height": 0.6,
"borderRadius": 3,
"showRelatedProduct": true,
"showRelatedProductFromSameStore": true,
"enableReview": true,
"showThumbnailAtLeast": 1,
"marginTop": 0,
"ShowSelectedImageVariant": true,
"ShowImageGallery": true,
"safeArea": false,
"showProductTags": true,
"layout": "simpleType"
},
"blogDetail": {
"showSharing": true,
"showHeart": true,
"enableAudioSupport": false,
"showTextAdjustment": true,
"showComment": true
},
"productVariantLayout": {
"size": "box",
"height": "option",
"color": "color",
"color-image": "image"
},
"productAddons": {
"allowVideoType": true,
"allowCustomType": true,
"fileUploadSizeLimit": 5,
"allowMultiple": false,
"allowImageType": true,
"allowedCustomType": ["png", "pdf", "docx"]
},
"cartDetail": {"minAllowTotalCartValue": 0, "maxAllowQuantity": 20},
"productVariantLanguage": {
"ar": {
"size": "بحجم",
"color-image": "اللون",
"height": "ارتفاع",
"color": "اللون"
},
"vi": {
"color": "Màu",
"height": "Chiều Cao",
"color-image": "Màu",
"size": "Kích thước"
},
"en": {
"height": "Height",
"color-image": "Color",
"size": "Size",
"color": "Color"
}
},
"excludedCategory": 311,
"saleOffProduct": {
"ShowCountDown": true,
"HideEmptySaleOffLayout": false,
"Color": "#C7222B"
},
"notStrictVisibleVariant": true,
"configChat": {
"UseRealtimeChat": false,
"version": "2",
"EnableSmartChat": true,
"showOnScreens": ["profile"],
"hideOnScreens": []
},
"smartChat": [
{
"iconData": "whatsapp",
"imageData": "https://i.imgur.com/tBE2iAn.png",
"app": "https://wa.me/+994506884408",
"description": "WhatsApp"
},
{
"iconData": "phone",
"app": "tel:+994506884408",
"description": "Zəng etmək"
}
],
"adminEmail": "admininspireui#gmail.com",
"adminName": "InspireUI",
"vendorConfig": {
"EnableAutoApplicationApproval": false,
"dokan": "my-account?vendor_admin=true",
"DisableDeliveryManagement": true,
"DisableVendorShipping": false,
"ExpandStoreLocationByDefault": true,
"DefaultStoreImage": "assets/images/default-store-banner.png",
"ShowAllVendorMarkers": true,
"wcfm": "store-manager?vendor_admin=true",
"DisableMultiVendorCheckout": false,
"DisableNativeStoreManagement": true,
"DisablePendingProduct": false,
"BannerFit": "cover",
"NewProductStatus": "draft",
"VendorRegister": true
},
"deliveryConfig": {
"enableSystemNotes": false,
"dashboardName1": "FluxStore",
"dashboardName2": "Delivery",
"appLogo": "assets/images/app_icon_transparent.png",
"appName": "FluxStore Delivery"
},
"managerConfig": {
"enableDeliveryFeature": false,
"appLogo": "assets/images/app_icon_transparent.png",
"appName": "FluxStore Admin"
},
"loadingIcon": {"type": "doubleBounce", "layout": "spinkit"},
"splashScreen": {
"type": "flare",
"paddingBottom": 0,
"animationName": "BEN\"O",
"backgroundColor": "#ffffff",
"duration": 2000,
"paddingTop": 0,
"paddingLeft": 0,
"boxFit": "contain",
"paddingRight": 0,
"enable": true,
"image":
"https://trello.com/1/cards/63d02a96e1774f2f698a187a/attachments/63d038558a12f82d3a6b12d2/download/logo.png"
},
"darkConfig": {
"primaryColorLight": "ff232323",
"MainColor": "ffffffff",
"backgroundColor": "ff232323",
"logo": "https://i.imgur.com/VuUCQJ2.png",
"textColor": "ffffffff"
},
"lightConfig": {
"logo": "https://i.imgur.com/QESdwM5.png",
"MainColor": "ff3fc1be"
},
"enableOnBoarding": true,
"addressFields": [
{
"position": 1,
"required": true,
"editable": true,
"type": "firstName",
"defaultValue": "",
"visible": true
},
{
"visible": true,
"defaultValue": "",
"editable": true,
"type": "lastName",
"position": 2,
"required": true
},
{
"visible": true,
"defaultValue": "",
"position": 3,
"required": true,
"editable": true,
"type": "phoneNumber"
},
{
"position": 4,
"editable": true,
"defaultValue": "",
"type": "email",
"required": true,
"visible": true
},
{"visible": true, "position": 5, "type": "searchAddress"},
{"type": "selectAddress", "visible": true, "position": 6},
{"type": "country", "visible": true, "position": 7},
{"visible": true, "position": 8, "type": "state"},
{
"editable": true,
"visible": true,
"position": 9,
"defaultValue": "",
"required": true,
"type": "city"
},
{
"visible": true,
"type": "apartment",
"editable": true,
"defaultValue": "",
"required": false,
"position": 10
},
{
"defaultValue": "",
"required": false,
"editable": true,
"position": 11,
"visible": true,
"type": "block"
},
{
"type": "street",
"editable": true,
"visible": true,
"position": 12,
"defaultValue": "",
"required": true
},
{
"editable": true,
"position": 13,
"visible": true,
"required": true,
"defaultValue": "",
"type": "zipCode"
}
],
"productCard": {
"showCartButtonWithQuantity": false,
"enableRating": true,
"showCartButton": false,
"hideStore": true,
"hideTitle": false,
"showCartIconColor": false,
"hidePrice": false,
"borderRadius": 3,
"showCartIcon": true,
"boxFit": "cover"
}
};
I bought the fluxstore program, connects via API to the WordPress site. The program works, but on the emulator it gives such an error.
FormatException (FormatException: Unexpected character (at character 1) ‰PNG ^ )
I deleted the entire image on the site but it didn't help. Deleted the Flutter project and reopened it. There are many solutions on the Internet, but I could not change my code in any way, I'm afraid to break the whole application. The program works on the web, but when I open it on the emulator, it gives the above error.

Failed to get certain files from IPFS cluster

Because public IPFS gateway is too slow, I set up own ipfs cluster using kubernetes on AWS.
However, when I tried to get files from the cluster, I succeeded for some files but failed for others consistently(failed one kept failing).
How do I debug this? Did I make mistake on configuration? Here's the configuration I used.
{
"API": {
"HTTPHeaders": {
"Access-Control-Allow-Methods": [
"PUT",
"POST"
],
"Access-Control-Allow-Origin": [
"http://localhost:3000",
"http://127.0.0.1:5001",
"https://webui.ipfs.io"
]
}
},
"Addresses": {
"API": "/ip4/0.0.0.0/tcp/5001",
"Announce": [],
"AppendAnnounce": [],
"Gateway": "/ip4/0.0.0.0/tcp/8080",
"NoAnnounce": [],
"Swarm": [
"/ip4/0.0.0.0/tcp/4001",
"/ip6/::/tcp/4001",
"/ip4/0.0.0.0/udp/4001/quic",
"/ip6/::/udp/4001/quic"
]
},
"AutoNAT": {},
"Bootstrap": [
"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
"/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
"/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
"/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
"/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
],
"DNS": {
"Resolvers": {}
},
"Datastore": {
"BloomFilterSize": 0,
"GCPeriod": "1h",
"HashOnRead": false,
"Spec": {
"mounts": [
{
"child": {
"path": "blocks",
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
"sync": true,
"type": "flatfs"
},
"mountpoint": "/blocks",
"prefix": "flatfs.datastore",
"type": "measure"
},
{
"child": {
"compression": "none",
"path": "datastore",
"type": "levelds"
},
"mountpoint": "/",
"prefix": "leveldb.datastore",
"type": "measure"
}
],
"type": "mount"
},
"StorageGCWatermark": 90,
"StorageMax": "10GB"
},
"Discovery": {
"MDNS": {
"Enabled": true,
"Interval": 10
}
},
"Experimental": {
"AcceleratedDHTClient": false,
"FilestoreEnabled": false,
"GraphsyncEnabled": false,
"Libp2pStreamMounting": false,
"P2pHttpProxy": false,
"StrategicProviding": false,
"UrlstoreEnabled": false
},
"Gateway": {
"APICommands": [],
"HTTPHeaders": {
"Access-Control-Allow-Headers": [
"X-Requested-With",
"Range",
"User-Agent"
],
"Access-Control-Allow-Methods": [
"GET"
],
"Access-Control-Allow-Origin": [
"*"
]
},
"NoDNSLink": false,
"NoFetch": false,
"PathPrefixes": [],
"PublicGateways": null,
"RootRedirect": "",
"Writable": false
},
"Identity": {
"PeerID": "<intentionally hide>"
},
"Internal": {},
"Ipns": {
"RecordLifetime": "",
"RepublishPeriod": "",
"ResolveCacheSize": 128
},
"Migration": {
"DownloadSources": [],
"Keep": ""
},
"Mounts": {
"FuseAllowOther": false,
"IPFS": "/ipfs",
"IPNS": "/ipns"
},
"Peering": {
"Peers": null
},
"Pinning": {
"RemoteServices": {}
},
"Plugins": {
"Plugins": null
},
"Provider": {
"Strategy": ""
},
"Pubsub": {
"DisableSigning": false,
"Router": ""
},
"Reprovider": {
"Interval": "12h",
"Strategy": "all"
},
"Routing": {
"Type": "dht"
},
"Swarm": {
"AddrFilters": null,
"ConnMgr": {
"GracePeriod": "20s",
"HighWater": 900,
"LowWater": 600,
"Type": "basic"
},
"DisableBandwidthMetrics": false,
"DisableNatPortMap": false,
"RelayClient": {
"Enabled": true
},
"RelayService": {
"Enabled": true
},
"Transports": {
"Multiplexers": {},
"Network": {},
"Security": {}
}
}
}

Json data is not populated in treeview panel

here below is my json formate i need to show in the treeview panel in extjs6
After loading store from server i am not able to see any records in Tree panel.
what should be the Model view and store for this json rendering in to the Tree view panel .
Thanks.
here is my code :
Model :
Ext.define('File', {
extend: 'Ext.data.TreeModel',
fields: [
{number: 'number', type: 'string'},
]
});
Store :
var store = Ext.create('Ext.data.TreeStore', {
model: 'File',
proxy: {
type: 'ajax',
url: 'component-tree.json',
reader: {
type: 'json',
rootProperty: 'components',
leaf: true,
children: 'components',
expanded: true,
},
},
folderSort: true,
});
View :
var tree = Ext.create('Ext.tree.Panel', {
autoLoad: true,
collapsible: true,
useArrows: true,
rootVisible: true,
store: store,
multiSelect: true,
width: 250,
height: 300,
viewConfig: {
plugins: {
ptype: 'treeviewdragdrop',
appendOnly: true
}
},
root: {
text: "Components",
expanded: true,
},
renderTo: document.body
});
component-tree.json :
{
"components": {
"state": "RELEASED",
"nodeType": "Component",
"checked": true,
"name": "PLATE - FOR CABINET - ASSEMBLY",
"level": 0,
"url": "http://example.com/Windchill/servlet/nexiles/tools/api/1.0/epmdocuments/OR:wt.epm.EPMDocument:4474031",
"oid": "OR:wt.epm.EPMDocument:4474031",
"modified": "17.04.2015",
"filename": "21378386.asm",
"num_children": 7,
"number": "21378386.ASM",
"details": "http://example.com/Windchill/app/#ptc1/tcomp/infoPage?oid=OR:wt.epm.EPMDocument:4474031&u8=1",
"components": [
{
"nodeType": "Component",
"leaf": true,
"name": "PLATE - FOR CABINET - DETAIL",
"level": 1,
"url": "http://example.com/Windchill/servlet/nexiles/tools/api/1.0/epmdocuments/OR:wt.epm.EPMDocument:4474018",
"oid": "OR:wt.epm.EPMDocument:4474018",
"modified": "17.04.2011",
"filename": "1234.prt",
"state": "RELEASED",
"number": "21378385.PRT",
"details": "http://example.com/Windchill/app/#ptc1/tcomp/infoPage?oid=OR:wt.epm.EPMDocument:4474018&u8=1",
"version": "A",
"checked": true,
"drawings": [
{
"reftype": "DRAWING",
"nodeType": "Drawing",
"leaf": true,
"name": "PLATE - FOR CABINET - DETAIL",
"url": "http://example.com/Windchill/servlet/nexiles/tools/api/1.0/epmdocuments/OR:wt.epm.EPMDocument:4474013",
"oid": "OR:wt.epm.EPMDocument:4474013",
"modified": "17.04.2015",
"filename": "21378385.drw",
"source": "representation",
"state": "RELEASED",
"number": "21378385.DRW",
"details": "http://example.com/Windchill/app/#ptc1/tcomp/infoPage?oid=OR:wt.epm.EPMDocument:4474013&u8=1",
"version": "A",
"checked": true,
"id": "OR:wt.epm.EPMDocument:4474013-DRAWING",
"icon": "/resources/images/drawing.gif"
},
{
"reftype": "INTERNAL",
"nodeType": "Drawing",
"leaf": true,
"name": "PLATE - FOR CABINET - ASSEMBLY",
"url": "http://example.com/Windchill/servlet/nexiles/tools/api/1.0/epmdocuments/OR:wt.epm.EPMDocument:4474041",
"oid": "OR:wt.epm.EPMDocument:4474041",
"modified": "17.04.2015",
"filename": "21378386.drw",
"source": "representation",
"state": "RELEASED",
"number": "21378386.DRW",
"details": "http://example.com/Windchill/app/#ptc1/tcomp/infoPage?oid=OR:wt.epm.EPMDocument:4474041&u8=1",
"version": "A",
"checked": true,
"id": "OR:wt.epm.EPMDocument:4474041-INTERNAL",
"icon": "/resources/images/drawing.gif"
}
],
"icon": "/resources/images/prt_image.gif"
}
}
Your treeModel just defines number but your store actually contains much more fields...
Take a look at the doc in the chapter 'Heterogeneous node types' for more information.
Try with children instead of components in your json file. By the way I could remark that the case is not respected between the configuration root: { text: "Components", ... } and the json content "components": [ ... ].
C and c

ExtJs Store Root

this is my JSON:
[{
"ActionBy": "om",
"ActionDate": "11\/26\/2013 8:50:56 AM",
"ActionDetails": [{
"Field": "St",
"NewValue": "Clo",
"OldValue": "Ch",
"UpdateType": "Tie"
}, {
"Field": "AssignedTo",
"NewValue": "mus",
"OldValue": "n",
"UpdateType": "As"
}]
And this my store:
historyStore = Ext.create('Ext.data.Store', {
fields: ['Field', 'NewValue', 'OldValue'],
autoLoad: true,
proxy: {
type: 'ajax',
url: url,
reader: {
type:'json',
root:''
}
},
listeners:{
load:function(that,records,view){
console.log(records);
}
},
autoLoad: true
});
I want show Field, NewValue and OldValue in grid panel,
But it does not work Store, in my opinion, I am root problem.
Is it true JSON?
What I need to write to Root?
Your json should be like :
{
"ActionBy": "nimet.seyman#beqom.com",
"ActionDate": "11\/26\/2013 8:50:56 AM",
"ActionDetails": [
{
"Field": "State",
"NewValue": "Closed",
"OldValue": "Check",
"UpdateType": "Ticket Update"
},
{
"Field": "AssignedTo",
"NewValue": "mustafa.arikci#beqom.com",
"OldValue": "nimet.seyman#beqom.com",
"UpdateType": "Assignment"
}
]
}
If it is in this way :
data =[{
"ActionBy": "nimet.seyman#beqom.com",
"ActionDate": "11\/26\/2013 8:50:56 AM",
"ActionDetails": [
{
"Field": "State",
"NewValue": "Closed",
"OldValue": "Check",
"UpdateType": "Ticket Update"
},
{
"Field": "AssignedTo",
"NewValue": "mustafa.arikci#beqom.com",
"OldValue": "nimet.seyman#beqom.com",
"UpdateType": "Assignment"
}
]
}]
Your store :
historyStore = Ext.create('Ext.data.Store', {
fields: ['Field', 'NewValue', 'OldValue'],
autoLoad: true,
proxy: {
type: 'ajax',
url: url,
reader: {
type:'json',
root:'ActionDetails'
}
}
});
Your json is not valid,you can use jsonlint.com to validate your json. add '} ]' to your json to complete it.
give root value as ActionDetails so it will take data from that node, like
root:'ActionDetails'

ExtJS4 How to set TreePanels root node from JSON

I want to create TreePanel using ExtJS4. So I'm sending JSON to proxy reader which has following format
{
"text": "en",
"children": {
"text": "/",
"children": [{
"text": "/page",
"children": [{
"text": "/page/new",
"children": [],
"leaf": true,
"expanded": false
},
{
"text": "/page/remove",
"children": [],
"leaf": true,
"expanded": false
}
],
"leaf": false,
"expanded": false
},
{
"text": "/home",
"children": [],
"leaf": true,
"expanded": false
}
],
"leaf": false,
"expanded": true
}
}
How do I have to configure my Store if I want en node to be my root node.
Ext.define('Example.store.WebItems', {
extend: 'Ext.data.TreeStore',
model: 'Example.model.Item',
proxy: {
type: 'ajax',
api: {
read: 'some/url',
},
reader: {
type: 'json',
root: 'children' // Is this correct?
}
},
root: // What should I write here?
});
When I define TreeStore's root as root: 'My Root' it will add new root, but I want to use root defined in JSON.
So my questions are:
How to use root node from JSON instead of defining it manualy?
Do I have to define root node in proxy reader and TreeStore as well?
Response has to have root.
For example:
{
MyRoot: {
"text": "en",
"children": {
"text": "/",
"children": [{
"text": "/page",
"children": [{
"text": "/page/new",
"children": [],
"leaf": true,
"expanded": false
}, {
"text": "/page/remove",
"children": [],
"leaf": true,
"expanded": false
}],
"leaf": false,
"expanded": false
}, {
"text": "/home",
"children": [],
"leaf": true,
"expanded": false
}],
"leaf": false,
"expanded": true
}
}
}
In this example root is MyRoot. Now you have to "tell" reader that your root is MyRoot:
// ...
reader: {
type: 'json',
root: 'MyRoot'
}
},
//root: this config is not needed now
});
As per I know, you need to specify root as following:
root: {
text: 'en',
id: 'src',
expanded: true '
}
Try the above code snippet it will help you.
May be late but for others , wrap the JSON inside array [] just like this :
[{
"text": "en",
"children": {
"text": "/",
"children": [{
"text": "/page",
"children": [{
"text": "/page/new",
"children": [],
"leaf": true,
"expanded": false
}, {
"text": "/page/remove",
"children": [],
"leaf": true,
"expanded": false
}],
"leaf": false,
"expanded": false
}, {
"text": "/home",
"children": [],
"leaf": true,
"expanded": false
}],
"leaf": false,
"expanded": true
}
}]
Remove the reader block
reader: {
type: 'json',
root: 'MyRoot'
}
Add root block :
root: {
text: 'en',
id: 'src',
expanded: true '
}
Add rootVisible: false in treepanel.