Related
I am trying to put items within the table and getting this error:
This is the objects.json file I am trying to insert into the db:
{
"Sensors":{
"L": [
{ "M": {
"Sensor": { "S": "Sensor1" },
"SensorDescription": { "S": "This is a description of a Sensor"},
"ImageFile": {"S": "/Sensors/image/Sensor1.txt"},
"SampleRate": {"N": "1"},
"Locations": {"S": "Orlando, FL"}
}
},
{ "M": {
"Sensor": { "S": "Sensor2" },
"SensorDescription": { "S": "This is a description of a Sensor"},
"ImageFile": {"S": "/Sensors/image/Sensor2.txt"},
"SampleRate": {"N": "2"},
"Locations": {"S": "Annapolis, MD"}
}
},
{ "M": {
"Sensor": { "S": "Sensor3" },
"SensorDescription": { "S": "This is a description of a Sensor"},
"ImageFile": {"S": "/Sensors/image/Sensor3.txt"},
"SampleRate": {"N": "3"},
"Locations": {"S": "Jacksonville, FL"}
}
},
{ "M": {
"Sensor": { "S": "Sensor4" },
"SensorDescription": { "S": "This is a description of a Sensor"},
"ImageFile": {"S": "/Sensors/image/Sensor4.txt"},
"SampleRate": {"N": "4"},
"Locations": {"S": "Balitimore, MD"}
}
},
{ "M": {
"Sensor": { "S": "Sensor5" },
"SensorDescription": { "S": "This is a description of a Sensor"},
"ImageFile": {"S": "/Sensors/image/Sensor5.txt"},
"SampleRate": {"N": "5"},
"Locations": {"S": "Washington DC"}
}
},
{ "M": {
"Sensor": { "S": "Sensor6" },
"SensorDescription": { "S": "This is a description of a Sensor"}
}
},
{ "M": {
"Sensor": { "S": "Sensor7" },
"SensorDescription": { "S": "This is a description of a Sensor" }
}
},
{ "M": {
"Sensor": { "S": "Sensor8" },
"SensorDescription": { "S": "This is a description of a Sensor"}
}
},
{ "M": {
"Sensor": { "S": "Sensor9" },
"SensorDescription": { "S": "This is a description of a Sensor"}
}
},
{ "M": {
"Sensor": { "S": "Sensor10" },
"SensorDescription": { "S": "This is a description of a Sensor"}
}
},
{ "M": {
"Sensor": { "S": "Sensor11" },
"SampleRate": {"N": "11"},
"Locations": {"S": "New York, NY"}
}
},
{ "M": {
"Sensor": { "S": "Sensor12" },
"SampleRate": {"N": "12"},
"Locations": {"S": "Buffalo, NY"}
}
},
{ "M": {
"Sensor": { "S": "Sensor13" },
"SampleRate": {"N": "13"},
"Locations": {"S": "Chicago, IL"}
}
},
{ "M": {
"Sensor": { "S": "Sensor14" },
"SampleRate": {"N": "14"},
"Locations": {"S": "Trenton, NJ"}
}
},
{ "M": {
"Sensor": { "S": "Sensor15" },
"SampleRate": {"N": "15"},
"Locations": {"S": "Los Angeles, CA"}
}
},
{ "M": {
"Sensor": { "S": "Sensor16" },
"SampleRate": {"N": "16"},
"SensorDescription": { "S": "This is a description of a Sensor"},
"AltName": {"S": "Sensor-16"}
}
},
{ "M": {
"Sensor": { "S": "Sensor17" },
"SampleRate": {"N": "17"},
"SensorDescription": { "S": "This is a description of a Sensor"},
"Date": {"S": "2022-09-11 15:00:00.000"}
}
},
{ "M": {
"Sensor": { "S": "Sensor18" },
"SampleRate": {"N": "18"},
"SensorDescription": { "S": "This is a description of a Sensor"},
"Working": {"BOOL": false }
}
},
{ "M": {
"Sensor": { "S": "Sensor19" },
"SampleRate": {"N": "19"},
"SensorDescription": { "S": "This is a description of a Sensor"},
"color": {"S": "Green" }
}
},
{ "M": {
"Sensor": { "S": "Sensor20" },
"SampleRate": {"N": "20"},
"SensorDescription": { "S": "This is a description of a Sensor"},
"Senor_type": {"S": "Type 2" }
}
}
]
}
}
Here is the table:
My eyes must be playing tricks on me because I can't see the issue or am I doing something else wrong? Any help is greatly appreciated.
Apparently my description of the issue is too short so I am writing this sentence so I may post..
While the previous answer by hunterhacker is correct, put-item cannot be used to insert batches of items. Instead, to insert a batch of items we must use batch-write-item which will allow us insert up to 25 items per batch:
https://docs.aws.amazon.com/cli/latest/reference/dynamodb/batch-write-item.html
For your use-case, you will need to alter your JSON slightly to make it work. I have edited your example given which you can further refer to and use:
{
"Sensors": [
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor1"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
},
"ImageFile": {
"S": "/Sensors/image/Sensor1.txt"
},
"SampleRate": {
"N": "1"
},
"Locations": {
"S": "Orlando, FL"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor2"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
},
"ImageFile": {
"S": "/Sensors/image/Sensor2.txt"
},
"SampleRate": {
"N": "2"
},
"Locations": {
"S": "Annapolis, MD"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor3"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
},
"ImageFile": {
"S": "/Sensors/image/Sensor3.txt"
},
"SampleRate": {
"N": "3"
},
"Locations": {
"S": "Jacksonville, FL"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor4"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
},
"ImageFile": {
"S": "/Sensors/image/Sensor4.txt"
},
"SampleRate": {
"N": "4"
},
"Locations": {
"S": "Balitimore, MD"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor5"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
},
"ImageFile": {
"S": "/Sensors/image/Sensor5.txt"
},
"SampleRate": {
"N": "5"
},
"Locations": {
"S": "Washington DC"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor6"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor7"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor8"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor9"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor10"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor11"
},
"SampleRate": {
"N": "11"
},
"Locations": {
"S": "New York, NY"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor12"
},
"SampleRate": {
"N": "12"
},
"Locations": {
"S": "Buffalo, NY"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor13"
},
"SampleRate": {
"N": "13"
},
"Locations": {
"S": "Chicago, IL"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor14"
},
"SampleRate": {
"N": "14"
},
"Locations": {
"S": "Trenton, NJ"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor15"
},
"SampleRate": {
"N": "15"
},
"Locations": {
"S": "Los Angeles, CA"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor16"
},
"SampleRate": {
"N": "16"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
},
"AltName": {
"S": "Sensor-16"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor17"
},
"SampleRate": {
"N": "17"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
},
"Date": {
"S": "2022-09-11 15:00:00.000"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor18"
},
"SampleRate": {
"N": "18"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
},
"Working": {
"BOOL": false
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor19"
},
"SampleRate": {
"N": "19"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
},
"color": {
"S": "Green"
}
}
}
},
{
"PutRequest": {
"Item": {
"Sensor": {
"S": "Sensor20"
},
"SampleRate": {
"N": "20"
},
"SensorDescription": {
"S": "This is a description of a Sensor"
},
"Senor_type": {
"S": "Type 2"
}
}
}
}
]
}
Now to insert this into your table, you can use the following batch-write-item command:
aws dynamodb batch-write-item \
--request-items file://sensors.json \
--return-consumed-capacity TOTAL
Hope that helps :)
The put-item call takes a singular item and you’re trying to pass a list. You can see the docs and format definition at https://docs.aws.amazon.com/cli/latest/reference/dynamodb/put-item.html
Hello Stackoverflow Users,
I'm trying to create a WordPress 6.0 Fullsite Editing Theme. But I am running into a issue which is driving me crazy.
I enabled a color palette in my theme.json file and can select the colors within the gutenberg editor. The Backend is even showing the correct colors.
Correct Colors within Gutenberg Editor
The frontend doesn't show the chosen colors from the Color pallete though. The Class is applied, but the color doesn't show up in the CSS.
No Color applied in the Frontend
If I apply a custom color from the color pallette, everything is working fine though.
Custom Colors are working
Custom Colors are working in the frontend
So I suspect, something in my theme.json is wrong.
Does someone has an Idea, what could cause this issue?
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": true,
"color": {
"defaultPalette": false,
"defaultGradients": false,
"link": true,
"custom": true,
"background": true,
"duotone": [
],
"palette": [
{
"slug": "white",
"color": "#ffffff",
"name": "Weiß"
},
{
"slug": "primary",
"color": "#D4B86A",
"name": "Akzentfarbe"
},
{
"slug": "black",
"color": "#000",
"name": "Schwarz"
},
{
"slug": "lightgrey",
"color": "#ECECEC",
"name": "Helles Grau"
},
{
"slug": "grey",
"color": "#D9D9D9",
"name": "Grau"
},
{
"slug": "darkgrey",
"color": "#3E3E3E",
"name": "Dunkles Grau"
},
{
"slug": "transparent",
"color": "rgba(255, 255, 255, 0)",
"name": "Transparent"
}
],
"gradients": [
{
"slug": "",
"gradient": "",
"name": ""
}
]
},
"spacing": {
"units": [
"%",
"px",
"em",
"rem",
"vh",
"vw"
]
},
"layout": {
"contentSize": "800px",
"wideSize": "1425px"
},
"typography": {
"dropCap": false,
"fontFamilies": [
{
"fontFamily": "Jost",
"name": "Jost",
"slug": "jost",
"fontFace": [
{
"fontFamily": "Jost",
"fontWeight": "300 400 700",
"fontStyle": "normal",
"src": [ "file:./assets/fonts/../fonts/jost-v13-latin-regular.woff2" ]
},
{
"fontFamily": "Jost",
"fontWeight": "300 400 700",
"fontStyle": "italic",
"src": [ "file:./assets/fonts/jost-v13-latin-300italic.woff2" ]
}
]
},
{
"fontFamily": "brandon-grotesque",
"name": "Brandon-grotesque",
"slug": "brandon-grotesque",
"fontFace": [
{
"fontFamily": "brandon-grotesque",
"fontWeight": "400 700",
"fontStyle": "normal",
"fontStretch": "normal",
"src": [ "https://use.typekit.net/af/XXXXXXXXXXXXX"},
{
"fontFamily": "brandon-grotesque",
"fontWeight": "400 700",
"fontStyle": "italic",
"fontStretch": "normal",
"src": [ "https://use.typekit.net/af/32d3ee/XXXXXXXXXXX" ]
}
]
}
],
"fontSizes": [
{
"size": "0.8rem",
"slug": "small",
"name": "Kleine Schrift"
},
{
"size": "clamp(1rem, 1rem + 2px, 1.2rem)",
"slug": "normal",
"name": "Standard"
},
{
"size": "clamp(0.8rem, 1rem + 4px, 1.3rem)",
"slug": "medium",
"name": "Standard"
},
{
"size": "clamp(1.2rem, 1rem + 1vw, 1.4rem)",
"slug": "large",
"name": "Große Schrift"
},
{
"size": "clamp(1.2rem, 1rem + 1vw, 1.5rem)",
"slug": "x-large",
"name": "Sehr große Schrift"
}
],
"customFontSize": true
},
"custom": {
"spacing": {
"small": "",
"medium": "",
"large": "",
"outer": "20px"
},
"typography": {
"font-size": {
"huge": "clamp(2.25rem, 4vw, 2.75rem)",
"gigantic": "clamp(2rem, 45px, 3rem)",
"colossal": "clamp(3.25rem, 8vw, 6.25rem)"
},
"line-height": {
"tiny": 1.0,
"small": 1.1,
"medium": 1.3,
"normal": 1.4,
"large": 1.6
}
}
}
},
"styles": {
"spacing":{
"blockGap": "1.5rem"
},
"typography": {
"fontSize": "var(--wp--custom--typography--font-size--normal",
"fontFamily": "var(--wp--preset--font-family--jost)",
"lineHeight": "var(--wp--custom--typography--line-height--normal)"
},
"elements": {
"h1": {
"typography": {
"fontFamily": "var(--wp--preset--font-family--jost)",
"fontWeight": "700",
"lineHeight": "var(--wp--custom--typography--line-height--medium)",
"fontSize": "var(--wp--custom--typography--font-size--gigantic)"
}
},
"h2": {
"typography": {
"fontFamily": "var(--wp--preset--font-family--jost)",
"fontWeight": "700",
"lineHeight": "var(--wp--custom--typography--line-height--medium)",
"fontSize": "var(--wp--custom--typography--font-size--gigantic)"
}
},
"h3": {
"typography": {
"fontFamily": "var(--wp--preset--font-family--jost)",
"fontWeight": "700",
"lineHeight": "var(--wp--custom--typography--line-height--medium)",
"fontSize": "var(--wp--custom--typography--font-size--gigantic)"
}
},
"h4": {
"typography": {
"fontFamily": "var(--wp--preset--font-family--jost)",
"fontWeight": "700",
"lineHeight": "var(--wp--custom--typography--line-height--medium)",
"fontSize": "var(--wp--custom--typography--font-size--gigantic)"
}
},
"h5": {
"typography": {
"fontFamily": "var(--wp--preset--font-family--jost)",
"fontWeight": "700",
"lineHeight": "var(--wp--custom--typography--line-height--medium)",
"fontSize": "var(--wp--custom--typography--font-size--gigantic)"
}
},
"h6": {
"typography": {
"fontFamily": "var(--wp--preset--font-family--jost)",
"fontWeight": "700",
"lineHeight": "var(--wp--custom--typography--line-height--medium)",
"fontSize": "var(--wp--custom--typography--font-size--gigantic)"
}
},
"link": {
"color": {
"text": "var(--wp--preset--color--primary)"
}
}
},
"blocks": {}
},
"templateParts": [
{
"name": "header",
"title": "Header",
"area": "header"
},
{
"name": "footer",
"title": "Footer",
"area": "footer"
}
],
"customTemplates": [
{
"name": "",
"title": "",
"postTypes": [ "post","page" ]
}
]
}
I found the issue. The Issue was caused by a syntax error inside of my theme.json.
The CSS Variables generated from your theme.json will be accessible in your htmls body tag. As I was checking the outputted CSS, i noticed, that the CSS Classes are actually existing, but was loaded in the wrong css property.
Css Variables within FontSize? Must be wrong!
So I checked all the fontSize properties, and found a missing bracket!
"typography": {
"fontSize": "var(--wp--custom--typography--font-size--normal"**)**,
"fontFamily": "var(--wp--preset--font-family--jost)",
"lineHeight": "var(--wp--custom--typography--line-height--normal)"
},
... now, everything is working properly!
You actually had a typo in this block:
{
"fontFamily": "brandon-grotesque",
"name": "Brandon-grotesque",
"slug": "brandon-grotesque",
"fontFace": [
{
"fontFamily": "brandon-grotesque",
"fontWeight": "400 700",
"fontStyle": "normal",
"fontStretch": "normal",
"src": [ "https://use.typekit.net/af/XXXXXXXXXXXXX"},
{
"fontFamily": "brandon-grotesque",
"fontWeight": "400 700",
"fontStyle": "italic",
"fontStretch": "normal",
"src": [ "https://use.typekit.net/af/32d3ee/XXXXXXXXXXX" ]
}
]
}
There's "}" instead of "]" on the "src" definition of the first normal font that you're defining.
/* excuse my english i'm french my split is nginx.access.response_code.keyword
lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
mmmmmmmmmmmmmmmmmm
mmmmmmmmmmmmmmmmmmmmm
mmmmmmmmmmmmmmmm
*/
{
"aggs": {
"2": {
"significant_terms": {
"field": "nginx.access.response_code.keyword",
"size": 10
},
"aggs": {
"3": {
"date_histogram": {
"field": "#timestamp",
"fixed_interval": "12h",
"time_zone": "Europe/Paris",
"min_doc_count": 1
}
}
}
}
},
"size": 0,
"stored_fields": [
"*"
],
"script_fields": {},
"docvalue_fields": [
{
"field": "#timestamp",
"format": "date_time"
},
{
"field": "event.created",
"format": "date_time"
},
{
"field": "read_timestamp",
"format": "date_time"
}
],
"_source": {
"excludes": []
},
"query": {
"bool": {
"must": [],
"filter": [
{
"match_all": {}
},
{
"range": {
"#timestamp": {
"gte": "2020-11-07T14:57:01.503Z",
"lte": "2020-12-07T14:57:01.503Z",
"format": "strict_date_optional_time"
}
}
}
],
"should": [],
"must_not": [
{
"match_phrase": {
"nginx.access.response_code.keyword": {
"query": "200"
}
}
},
{
"match_phrase": {
"nginx.access.response_code.keyword": {
"query": "301"
}
}
},
{
"match_phrase": {
"nginx.access.response_code.keyword": {
"query": "304"
}
}
}
]
}
}
}
/* the result my buckets are empty */
{
"took": 302,
"timed_out": false,
"_shards": {
"total": 11,
"successful": 11,
"skipped": 10,
"failed": 0
},
"hits": {
"total": 6418480,
"max_score": null,
"hits": []
},
"aggregations": {
"2": {
"buckets": []
}
}
}
I found it. it did not exist in my data nginx.access.response_code.keyword. Be careful, Kibana does not show you your error.
Currently query below removes duplicates on a single field - "name", but we need top_hits results for all fields:"name", "venueName", "venueTown". Is this possible to achieve within one query without sending 3 requests and setting "field" to be "venueName" and "venueTown"?
{
"aggs": {
"query": {
"terms": {
"field": "name"
}
,
"aggs": {
"top": {
"top_hits": {
"size": 1
}
}
}
}
},
"size": 0,
"query": {
"multi_match": {
"query": "LAURA",
"operator": "OR",
"fields": [
"name",
"venueName",
"venueTown"
]
}
}
}
If I understand correctly, you can write multiple aggregations with top hits.
{
"query": {
"multi_match": {
"query": "LAURA",
"fields": [
"name",
"venueName",
"venueTown",
]
}
},
"aggs": {
"name": {
"terms": {
"field": "name"
},
"aggs": {
"top": {
"top_hits": {
"size": 1
}
}
}
},
"venue_name": {
"terms": {
"field": "venueName"
},
"aggs": {
"top": {
"top_hits": {
"size": 1
}
}
}
},
"venue_town": {
"terms": {
"field": "venueTown"
},
"aggs": {
"top": {
"top_hits": {
"size": 1
}
}
}
}
}
}
I want to do something event.setColorId("RED") to change my event color
unfortunetaly this is the response i got
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid Value",
"reason" : "invalid"
} ],
"message" : "Invalid Value"
}
does anyone know the correct way?
Thanks
You should do event.setColorId("11") for red.
These are all the possible options for colorId.
"1": {
"background": "#ac725e",
"foreground": "#1d1d1d"
},
"2": {
"background": "#d06b64",
"foreground": "#1d1d1d"
},
"3": {
"background": "#f83a22",
"foreground": "#1d1d1d"
},
"4": {
"background": "#fa573c",
"foreground": "#1d1d1d"
},
"5": {
"background": "#ff7537",
"foreground": "#1d1d1d"
},
"6": {
"background": "#ffad46",
"foreground": "#1d1d1d"
},
"7": {
"background": "#42d692",
"foreground": "#1d1d1d"
},
"8": {
"background": "#16a765",
"foreground": "#1d1d1d"
},
"9": {
"background": "#7bd148",
"foreground": "#1d1d1d"
},
"10": {
"background": "#b3dc6c",
"foreground": "#1d1d1d"
},
"11": {
"background": "#fbe983",
"foreground": "#1d1d1d"
},
"12": {
"background": "#fad165",
"foreground": "#1d1d1d"
},
"13": {
"background": "#92e1c0",
"foreground": "#1d1d1d"
},
"14": {
"background": "#9fe1e7",
"foreground": "#1d1d1d"
},
"15": {
"background": "#9fc6e7",
"foreground": "#1d1d1d"
},
"16": {
"background": "#4986e7",
"foreground": "#1d1d1d"
},
"17": {
"background": "#9a9cff",
"foreground": "#1d1d1d"
},
"18": {
"background": "#b99aff",
"foreground": "#1d1d1d"
},
"19": {
"background": "#c2c2c2",
"foreground": "#1d1d1d"
},
"20": {
"background": "#cabdbf",
"foreground": "#1d1d1d"
},
"21": {
"background": "#cca6ac",
"foreground": "#1d1d1d"
},
"22": {
"background": "#f691b2",
"foreground": "#1d1d1d"
},
"23": {
"background": "#cd74e6",
"foreground": "#1d1d1d"
},
"24": {
"background": "#a47ae2",
"foreground": "#1d1d1d"
}
},
"event": {
"1": {
"background": "#a4bdfc",
"foreground": "#1d1d1d"
},
"2": {
"background": "#7ae7bf",
"foreground": "#1d1d1d"
},
"3": {
"background": "#dbadff",
"foreground": "#1d1d1d"
},
"4": {
"background": "#ff887c",
"foreground": "#1d1d1d"
},
"5": {
"background": "#fbd75b",
"foreground": "#1d1d1d"
},
"6": {
"background": "#ffb878",
"foreground": "#1d1d1d"
},
"7": {
"background": "#46d6db",
"foreground": "#1d1d1d"
},
"8": {
"background": "#e1e1e1",
"foreground": "#1d1d1d"
},
"9": {
"background": "#5484ed",
"foreground": "#1d1d1d"
},
"10": {
"background": "#51b749",
"foreground": "#1d1d1d"
},
"11": {
"background": "#dc2127",
"foreground": "#1d1d1d"
}